/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net;

import engine.ani.Npc;
import engine.ani.Player;
import engine.goods.Goods;
import engine.map.Map;
import engine.skill.SkillBuff;
import engine.skill.SkillBuffManager;
import engine.skill.SkillManager;
import function.Property;
import function.QuickOption;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Vector;
import javax.microedition.lcdui.Image;

import com.xl.lib.Utils;

import mainpackage.Constant;
import mainpackage.GameBean;
import mainpackage.InputInterFace;
import mainpackage.MainCanvas;
import mainpackage.MainGame;
import mainpackage.MainLogic;
import mainpackage.MainView;
import mainpackage.ResManager;
import mainpackage.Rms;
import mainpackage.Tools;
import ui.UiInterFace;

/**
 *
 * @author Administrator
 */
public class NetDataPro {

    public static NetDataPro instance;

    public NetDataPro() {
        instance = this;
    }

	public void processMessage3(int msgId, DataInputStream cmdData) {

		try {
			processMessage3_1(msgId, cmdData);
			processMessage3_2(msgId, cmdData);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

    public void processMessage3_1(int msgId, DataInputStream cmdData) throws IOException {

            int i, j;
            switch (msgId) {
                case Constant.MSG_NET_CMD_TONG_CHANGE_POSITION:
                    byte stateCode = cmdData.readByte();
                    long id;
                    switch (stateCode) {
                        case 0://失败
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "操作失败!", (byte) 1, (byte) -1);
                            break;
                        case 1://成功
                            id = cmdData.readLong();//被改变职位玩家ID
                            String name = cmdData.readUTF();//被改变职位玩家的名字
                            byte duty = cmdData.readByte();//被改变的职位
                            String tempDuty = null;
                            switch (duty) {
                                case 0://帮众
                                    tempDuty = "帮众";
                                    break;
                                case 1://长老
                                    tempDuty = "长老";
                                    break;
                                case 2://护法
                                    tempDuty = "护法";
                                    break;
                                case 3://副帮主
                                    tempDuty = "副帮主";
                                    break;
                                case 4://帮主
                                    tempDuty = "帮主";
                                    break;
                            }
                            MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 4, "会员" + name + "的职位被更改为" + tempDuty);
                            name = null;
                            if (MainLogic.getInstance().gamePlayer.lPlayerID == id) {//更新自己的帮派职位
                                MainLogic.getInstance().gamePlayer.bTongDuty = duty;
                            }
                            if (MainLogic.getInstance().byGameState == Constant.GAME_UI_TONG_MEMBER_LIST) {
                                for (i = 0; i < MainLogic.getInstance().uiInterFace.tong.tongId.length; i++) {//更新帮派成员列表
                                    if (MainLogic.getInstance().uiInterFace.tong.tongId[i] == id) {
                                        MainLogic.getInstance().uiInterFace.tong.duty[i] = duty;
                                        break;
                                    }
                                }
                            }
                            break;
                        case 2://权限不够
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您的权限不够!", (byte) 1, (byte) -1);
                            break;
                        case 3://目标职位没有空缺
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "该职位目前没有空缺!", (byte) 1, (byte) -1);
                            break;
                    }
                    break;
                case Constant.MSG_NET_CMD_TONG_LEAVE: //离开帮派
                    stateCode = cmdData.readByte();
                    switch (stateCode) {
                        case 0://失败
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "操作失败！", (byte) 1, (byte) -1);
                            break;
                        case 1://成功
                            id = cmdData.readLong();
                            String name = cmdData.readUTF();
                            if (MainLogic.getInstance().byGameState == Constant.GAME_UI_TONG_MEMBER_LIST) {
                                int index = 0;
                                index = MainLogic.getInstance().uiInterFace.tong.setIndex(id);
                                MainLogic.getInstance().uiInterFace.tong.setTongMember(index);
                                //#if NOKIA_S60V5
                                 MainLogic.getInstance().uiInterFace.tong.iPositionY = Constant.UI_START_Y + 41;
                                //#else
//#                                MainLogic.getInstance().uiInterFace.tong.iPositionY = Constant.UI_START_Y + 21;
                                //#endif
//                                                MainLogic.getInstance().send(Constant.MSG_NET_CMD_TONG_MEMBER_LIST, Constant.SOCKET_MSG_TYPE_LOGIC);
                            }
                            if (id == MainLogic.getInstance().gamePlayer.lPlayerID) {
                                MainLogic.getInstance().gamePlayer.sTongName = null;
                                MainLogic.getInstance().gamePlayer.bTongDuty = 0;
                                MainLogic.getInstance().gamePlayer.lTongId = -1;
                            }
                            MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 4, name + "退出了帮派");
                            name = null;
                            break;
                        case 2://权限不够
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "权限不够!", (byte) 1, (byte) -1);
                            break;
                    }
                    break;
                case Constant.MSG_NET_TONG_CHANGE_DESCRIPT://修改帮派公告
                    stateCode = cmdData.readByte();
                    switch (stateCode) {
                        case 0://失败
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "修改失败!", (byte) 1, (byte) -1);
                            break;
                        case 1://成功
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "修改成功!", (byte) 1, (byte) -1);
                            break;
                        case 2://权限不够
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "权限不够!", (byte) 1, (byte) -1);
                            break;
                        case 3://玩家不在自己的帮派家园中
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "玩家不在自己的帮派家园中!", (byte) 1, (byte) -1);
                            break;
                    }
                    break;
                case Constant.MSG_NET_TONG_NPC_UPGRADE://帮派NPC建筑升级
                    stateCode = cmdData.readByte();
                    switch (stateCode) {
                        case 0://失败
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "升级失败!", (byte) 1, (byte) -1);
                            break;
                        case 1://成功
                            MainLogic.getInstance().send(Constant.MSG_NET_TONG_NPC_INFO, Constant.SOCKET_MSG_TYPE_LOGIC);
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "升级成功!", (byte) 1, (byte) -1);
                            break;
                        case 2://权限不够
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "权限不够!", (byte) 1, (byte) -1);
                            break;
                        case 3://帮派资金不够
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "帮派资金不够!", (byte) 1, (byte) -1);
                            break;
                        case 4://已达到最大等级
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "当前帮派等级未达到升级要求!", (byte) 1, (byte) -1);
                            break;
                    }
                    break;
                case Constant.MSG_NET_TONG_NPC_INFO://帮派NPC等级
                    stateCode = cmdData.readByte();
                    if (stateCode == 1) {
                        byte[] tongLv = new byte[5];
                        int[] tongMoney = new int[5];
                        for (i = 0; i < 5; i++) {
                            tongLv[i] = cmdData.readByte();
                            if (tongLv[i] == 5) {
                                tongMoney[i] = 0;
                            } else {
                                tongMoney[i] = cmdData.readInt();
                            }
                        }
                        MainLogic.getInstance().pushState(Constant.GAME_UI_TONG_MENU, true);
                        MainLogic.getInstance().uiInterFace.tong.setTongMenuInfo(tongLv, tongMoney);
                        tongLv = null;
                        tongMoney = null;
                    } else if (stateCode == 2) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "获取失败,玩家不在自己的帮派家园中!", (byte) 1, (byte) -1);
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "获取失败!", (byte) 1, (byte) -1);
                    }
                    break;
                case Constant.MSG_NET_CMD_TONG_DESCRIPT:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    MainLogic.getInstance().pushState(Constant.GAME_UI_TONG_INFO, true);
                    String tongNO = cmdData.readUTF();//帮派代号
                    String tongName = cmdData.readUTF();//帮派名称
                    String tongADS = cmdData.readUTF();//帮派宣言
                    String leaderName = cmdData.readUTF();//帮主名称
                    byte tongLv = cmdData.readByte();//帮派等级
                    byte tongMerNum = cmdData.readByte();//帮派当前人数
                    byte tongMerMaxNum = cmdData.readByte();//帮派最大人数
                    long money = cmdData.readLong();//帮派资金
                    long myMoney = cmdData.readLong();//我的帮贡
                    MainLogic.getInstance().uiInterFace.tong.initTongInfo(tongName, tongNO, leaderName, tongLv, tongMerNum, tongMerMaxNum, money, myMoney, tongADS);
                    tongNO = null;//帮派代号
                    tongName = null;//帮派名称
                    tongADS = null;//帮派宣言
                    leaderName = null;//帮主名称
                    break;
                case Constant.MSG_NET_CMD_TONG_LIST:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    long tongId = 0;//帮派ID
                    tongName = "";//帮派名字
                    byte tongLevel = -1;//帮派等级
                    tongMerNum = -1;//帮派人数
                    long tongDate = -1;//建帮时间
                    int tongNum = cmdData.readInt();
                    MainLogic.getInstance().pushState(Constant.GAME_UI_TONG_LIST, true);
                    MainLogic.getInstance().uiInterFace.tong.initTongNum(tongNum);
                    for (int k = 0; k < tongNum; k++) {
                        tongId = cmdData.readLong();
                        tongName = cmdData.readUTF();//名称
                        tongLevel = cmdData.readByte();//等级
                        tongMerNum = cmdData.readByte();//人数
                        tongDate = cmdData.readLong();//建帮时间
                        MainLogic.getInstance().uiInterFace.tong.getTongListInformation(k, tongId, tongName,
                                tongLevel, tongMerNum, tongDate);
                    }
                    tongName = null;
                    break;
                case Constant.MSG_NET_CMD_TONG_MEMBER_LIST:
                    short merber_num = 0;//成员数量
                    long merber_id = 0;//成员ID
                    String merber_name = "";//成员名字
                    byte merber_duty = 0;//成员职位
                    int merber_level = 0;//成员等级
                    byte merber_onLine = 0;//是否在线
                    merber_num = cmdData.readShort();
                    MainLogic.getInstance().pushState(Constant.GAME_UI_TONG_MEMBER_LIST, true);
                    MainLogic.getInstance().uiInterFace.tong.initTongMemberNum(merber_num);
                    for (int k = 0; k < merber_num; k++) {
                        merber_id = cmdData.readLong();
                        merber_name = cmdData.readUTF();
                        merber_duty = cmdData.readByte();
                        merber_level = cmdData.readInt();
                        merber_onLine = cmdData.readByte();
                        MainLogic.getInstance().uiInterFace.tong.initTongMemberList(k, merber_id, merber_name, merber_duty, merber_level, merber_onLine);
                    }
                    merber_name = null;
                    MainLogic.getInstance().uiInterFace.tong.index = MainLogic.getInstance().uiInterFace.tong.setIndex(MainLogic.getInstance().gamePlayer.lPlayerID);
//                                    Tools.printLog("读取完成");
                    break;
                case Constant.MSG_NET_INVITE_TONG:
                    stateCode = cmdData.readByte();
                    if (stateCode == 1) {
                        id = 0;//发起人ID
                        String note = null;//对话
                        id = cmdData.readLong();
                        tongName = cmdData.readUTF();
                        GameBean.STR_CMD_TONG_NO = tongName;
                        GameBean.L_PLAYER_ID = id;
                        tongId = cmdData.readLong();
                        GameBean.L_CMD_TONG_ID = tongId;
                        note = cmdData.readUTF();
                        GameBean.BY_CMD_INVITE_TONG_TYPE = 2;
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", note, (byte) 0, Constant.GAME_UI_ROAM);
                        note = null;
                    } else if (stateCode == 2) {
                        tongName = cmdData.readUTF();
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", tongName + "拒绝加入您的帮派!", (byte) 1, (byte) -1);
                        tongName = null;
                    }
                    break;
                //锁定情况下要buff
// 目标buff个数 (byte)	Buff key（8byte）	Buff类型(byte)	持续时间
//(4byte)	Buff图标(byte)	已用时间（int）
                case Constant.MSG_NET_BUFF_OPT:
                    String buffkey = null;
                    byte buffType = -1;
                    int buffContinueTime = -1;
                    byte buffIcon = -1;
                    int passTime = -1;
                    byte buffNums = cmdData.readByte();
                    Tools.printLog("buffer数量：：：" + buffNums);
                    for (int k = buffNums - 1; k >= 0; k--) {
                        buffkey = cmdData.readUTF();
                        buffType = cmdData.readByte();
                        buffContinueTime = cmdData.readInt();
                        buffIcon = cmdData.readByte();
                        passTime = cmdData.readInt();
                        SkillBuffManager.addToBuffTable(k, GameBean.L_PLAYER_ID, buffkey, buffType, -1, buffContinueTime, passTime, buffIcon);
                    }
                    buffkey = null;
                    break;
                //卸载buffBuff key(变长)	是否使用技能(byte)	是否使用物品(byte)	玩家速度(2byte)

                case Constant.MSG_NET_CMD_DELETE_BUFF:
                    buffkey = cmdData.readUTF();
                    byte attackeruseskill = cmdData.readByte();
                    byte byattackerusegood = cmdData.readByte();
                    short shAttackerSpeed = cmdData.readShort();
//                                    最大血(4byte)	最大蓝(4byte)当前血(4byte)	当前蓝(4byte)
                    int iMaxHP = cmdData.readInt();
                    int iMaxMP = cmdData.readInt();
                    int iHP = cmdData.readInt();
                    int iMP = cmdData.readInt();
                    //变身ID
                    String avatarid = cmdData.readUTF();
                    byte doubleExp = cmdData.readByte();
                    GameBean.BL_PLAYER_HANGUP_DOUBLEEXP = (doubleExp == 1) ? true : false;//双倍经验
                    MainLogic.getInstance().gamePlayer.changeAvatar(avatarid);
                    MainLogic.getInstance().gamePlayer.blCanUseSkill = (attackeruseskill == 1) ? true : false;
                    MainLogic.getInstance().gamePlayer.blCanUseGoods = (byattackerusegood == 1) ? true : false;
                    MainLogic.getInstance().gamePlayer.updateSpeed(shAttackerSpeed);
                    MainLogic.getInstance().gamePlayer.iPlayerMP = iMP;
                    MainLogic.getInstance().gamePlayer.iPlayerHP = iHP;
                    MainLogic.getInstance().gamePlayer.iPlayerMaxMP = iMaxMP;
                    MainLogic.getInstance().gamePlayer.iPlayerMaxHP = iMaxHP;
                    SkillBuff aSkillBuff = (SkillBuff) SkillBuffManager.buffTable.get(new Long(MainLogic.getInstance().gamePlayer.lPlayerID));
                    if (aSkillBuff != null) {
                        for (i = 0; i < SkillBuffManager.buffTable.size(); i++) {
                            if (aSkillBuff.iBuffKey != null && aSkillBuff.iBuffKey[i] != null && aSkillBuff.iBuffKey[i].equals(buffkey)) {
                                aSkillBuff.clearBuff(i);
                                return;
                            }
                        }
                    }
                    break;
                case Constant.MSG_NET_CMD_QUEST_LIST:
                    byte byTaskType = cmdData.readByte();
                    short shTaskNum = cmdData.readShort();
                    String[] sTaskList = null;
                    String[] sTempTask = null;
                    byte bySingleTaskState = -1;
                    if (shTaskNum > 0) {
                        sTaskList = new String[shTaskNum * 8];
                        byte byMainTaskPlace = -1;
                        for (i = 0; i < shTaskNum; i++) {
                            //任务key
                            sTaskList[8 * i] = cmdData.readUTF();
                            sTaskList[8 * i + 1] = cmdData.readUTF();//名称
                            //等级
                            short shLevel = cmdData.readShort();
                            if (byTaskType == 2 && sTaskList[8 * i].charAt(0) == '1') {
                                if (MainLogic.getInstance().gamePlayer.iPlayerLevel >= shLevel) {
                                    bySingleTaskState = 1;
                                } else {
                                    bySingleTaskState = 0;
                                }
                            }
                            sTaskList[8 * i + 2] = "【" + String.valueOf(shLevel) + "】";
                            sTaskList[8 * i + 3] = null;
                            sTaskList[8 * i + 4] = cmdData.readUTF();
                            sTaskList[8 * i + 5] = String.valueOf(cmdData.readInt());
                            sTaskList[8 * i + 6] = String.valueOf(cmdData.readInt());
                            if (byTaskType == 0) {
                                sTaskList[8 * i + 7] = String.valueOf(cmdData.readByte());
                            }
                        }
                        //对主线重新排序
                        if (byMainTaskPlace != -1 && byMainTaskPlace > 0) {
                            sTempTask = new String[8];
                            for (i = 0; i < 8; i++) {
                                sTempTask[i] = sTaskList[byMainTaskPlace * 8 + i];
                            }
                            for (i = byMainTaskPlace; i > 0; i--) {
                                for (j = 0; j < 8; j++) {
                                    sTaskList[i * 8 + j] = sTaskList[(i - 1) * 8 + j];
                                }
                            }
                            for (i = 0; i < 8; i++) {
                                sTaskList[i] = sTempTask[i];
                            }
                            sTempTask = null;
                        }
                    }
                    MainLogic.getInstance().uiInterFace.npcTalk.setTaskList(sTaskList, byTaskType, bySingleTaskState);
                    sTaskList = null;
                    break;
                case Constant.MSG_NET_CMD_TEAM_DISMISS:
                    //解散队伍
                    MainLogic.getInstance().uiInterFace.team.teamDismiss();
                    break;
                case Constant.MSG_NET_CMD_TEAM_LEAVE:
                    long teamMemberID = cmdData.readLong();
                    MainLogic.getInstance().uiInterFace.team.teamLeave(teamMemberID);
                    break;
                case Constant.MSG_NET_CMD_FUNC_COMPOSE:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    stateCode = cmdData.readByte();
                    if (stateCode == 1) {
                        long lGoodsKey = cmdData.readLong();
                        int iconID = cmdData.readInt();
                        String sAliars = cmdData.readUTF();
                        short level = cmdData.readShort();
                        short shStackNum = cmdData.readShort();
                        byte byDurability = cmdData.readByte();
                        byte byColor = cmdData.readByte();
                        byte byComposeItemNum = cmdData.readByte();
                        byte[] byGoodsNum = null;
                        if (byComposeItemNum > 0) {
                            byGoodsNum = new byte[byComposeItemNum];
                            for (i = 0; i < byComposeItemNum; i++) {
                                byGoodsNum[i] = cmdData.readByte();
                            }
                        }
                        MainLogic.getInstance().uiInterFace.equipment.completeCompose(stateCode, lGoodsKey, iconID, sAliars, level, shStackNum, byDurability, byColor, byGoodsNum);
                        sAliars = null;
                    } else {
                        MainLogic.getInstance().uiInterFace.equipment.completeCompose(stateCode, -1, -1, null, (short) -1, (short) -1, (byte) -1, (byte) -1, null);
                    }
                    //合成
                    break;
                case Constant.MSG_NET_CMD_FUNC_DECOMPOSE:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    //分解物品
                    stateCode = cmdData.readByte();
                    if (stateCode == 1 || stateCode == 5) {
                        byte num = cmdData.readByte();
                        long lGoodsKey;
                        int iIconId;
                        short shStackNum, shGoodsLevel;
                        byte byColor, byDurability;
                        String sGoodsName;
                        for (i = 0; i < num; i++) {
                            lGoodsKey = cmdData.readLong();
                            iIconId = cmdData.readInt();
                            sGoodsName = cmdData.readUTF();
                            shGoodsLevel = cmdData.readShort();
                            shStackNum = cmdData.readShort();
                            byDurability = cmdData.readByte();
                            byColor = cmdData.readByte();
                            if (MainLogic.getInstance().uiInterFace.equipment.items != null) {
                                MainLogic.getInstance().uiInterFace.equipment.items.addGoods((short) (i + 1), true, lGoodsKey, (short) -1, sGoodsName, shStackNum, iIconId, (byte) -1, byColor, (byte) -1, (byte) -1, (byte) -1, null, shGoodsLevel, -1, byDurability, null);
                            }
                        }
                        sGoodsName = null;
                    }
                    if (MainLogic.getInstance().byGameState == Constant.GAME_UI_ITEMS_DECOMPOSE) {
                        MainLogic.getInstance().uiInterFace.equipment.completeItemsDeCompose(stateCode);
                    }
                    break;
                case Constant.MSG_NET_CMD_FUNC_COMPOSE_MONEY:
                    stateCode = cmdData.readByte();
                    money = 0L;
                    byte byStrengthenLevel = 0;
                    byte byHoleNum = 0;
                    int iPower = 0;
                    if (stateCode == 1) {
                        money = cmdData.readLong();
                        iPower = cmdData.readInt();
                        byStrengthenLevel = cmdData.readByte();
                        byHoleNum = cmdData.readByte();
                        MainLogic.getInstance().uiInterFace.equipment.setComposeMoney(stateCode, money, iPower, byStrengthenLevel, byHoleNum);
                    } else {
                        MainLogic.getInstance().uiInterFace.equipment.setComposeMoney(stateCode, money, iPower, byStrengthenLevel, byHoleNum);
                    }
                    break;
                case Constant.MSG_NET_CMD_FUNC_STRENGTH_MONEY:
                    stateCode = cmdData.readByte();
                    money = 0L;
                    if (stateCode == 1 || stateCode == 6) {
                        money = cmdData.readLong();
                        byte byStrengthenGemNum = cmdData.readByte();
                        byStrengthenLevel = cmdData.readByte();
                        short shStrengthenAddition = cmdData.readShort();
                        short shNextStrengthenAddition = cmdData.readShort();
                        MainLogic.getInstance().uiInterFace.equipment.setStrengthenMoney(stateCode, MainLogic.getInstance().uiPackage.getCurrentPackage(), MainLogic.getInstance().uiPackage.shPos, money, byStrengthenGemNum, byStrengthenLevel, shStrengthenAddition, shNextStrengthenAddition);
                    } else {
                        MainLogic.getInstance().uiInterFace.equipment.setStrengthenMoney(stateCode, null, (short) 0, 0L, (byte) -1, (byte) -1, (short) 0, (short) 0);
                    }
                    break;
                case Constant.MSG_NET_CMD_QUEST_INFO:
                    String missionName = cmdData.readUTF(); // 任务名称
                    short shTaskLevel = cmdData.readShort();//任务等级
                    String missionObj = cmdData.readUTF();//任务目标
                    long lMoney = cmdData.readLong();//奖励金钱
                    int iExp = cmdData.readInt();//奖励经验
                    iPower = cmdData.readInt(); //奖励修为
                    short shSendStoneNum = cmdData.readShort(); //背包中传送石头的个数
                    byte byTaskStatus = cmdData.readByte(); //当前任务状态
                    byte byItemChoiceStyle = cmdData.readByte(); // 任务物品奖励类型
                    byte byHasJobLimit = cmdData.readByte();//任务是否有职业限制
                    short goodsTypeNums = cmdData.readShort(); //奖励的物品数量
                    int iIconID;
                    byte byLevel;
                    int iStackNum;
                    byte byColor = -1;
                    byte byJob = -1;
                    byte byBind;
                    String sGoodsKey;
                    String sGoodsName;
                    if (goodsTypeNums > 0) {
                        MainLogic.getInstance().uiInterFace.npcTalk.items = new Goods(goodsTypeNums, Constant.ITEM_COLUMN_TYPE_COMMON);
                        for (j = 0; j < goodsTypeNums; j++) {
                            sGoodsKey = cmdData.readUTF();
                            sGoodsName = cmdData.readUTF();
                            iIconID = cmdData.readShort();
                            byLevel = cmdData.readByte();
                            iStackNum = cmdData.readInt();
                            byColor = cmdData.readByte();
                            byJob = cmdData.readByte();
                            byBind = cmdData.readByte();
                            MainLogic.getInstance().uiInterFace.npcTalk.items.addGoods((short) j, true, -1L, (short) -1, sGoodsName, (short) iStackNum, Math.abs(iIconID), (byte) -1, byColor, byJob, (byte) -1, byBind, null, byLevel, -1, (byte) -1, sGoodsKey);
                        }
                    }
                    //查看任务
                    MainLogic.getInstance().uiInterFace.npcTalk.setTask((byte) 2, -1L, missionName, missionObj, lMoney, iExp, iPower, byItemChoiceStyle, shSendStoneNum, byTaskStatus, shTaskLevel, byHasJobLimit, (byte) -1);
                    missionName = null;
                    missionObj = null;
                    sGoodsName = null;
                    sGoodsKey = null;
                    break;
                case Constant.MSG_NET_CMD_OPEN_PET:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    stateCode = cmdData.readByte();
                    //0:宠物类型型(食草，食肉，杂食)//1:资质  //2:成长//3:当前宠物状态//4:当前经验值//5:最大经验值
                    //6:快乐度 //7:当前潜能//8:最大潜能//9:智力//10:精力// //11:力量//12:灵敏//13:宠物槽数量
                    if (stateCode == 1) {
                        byte byPlayerType = cmdData.readByte();
                        byte byMaxPetEquip = cmdData.readByte();
                        byte byPetEquipNum = cmdData.readByte();
                        long lGoodsKey;
                        String desc;
                        byte bySkillIndex = 0;
                        byte bySkillNum = 0;
                        byte shLevel = 0;
                        MainLogic.getInstance().uiInterFace.pet.items = new Goods((short) 6, Constant.ITEM_COLUMN_TYPE_PET_EQUIP);
                        MainLogic.getInstance().uiInterFace.pet.sHashtable = new Hashtable();
                        if (byPetEquipNum > 0) {
                            MainLogic.getInstance().uiInterFace.pet.iArray = new int[byPetEquipNum * 14];
                            MainLogic.getInstance().uiInterFace.pet.iAvatarID = new int[byPetEquipNum];
                            MainLogic.getInstance().uiInterFace.pet.shPetState = new short[byPetEquipNum];
                            for (i = 0; i < byPetEquipNum; i++) {
                                MainLogic.getInstance().uiInterFace.pet.iAvatarID[i] = Integer.parseInt(cmdData.readUTF());
                                MainLogic.getInstance().uiInterFace.pet.shPetState[i] = cmdData.readShort();
                                lGoodsKey = cmdData.readLong();
                                sGoodsName = cmdData.readUTF();
                                //类型
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14] = cmdData.readByte();
                                iIconID = cmdData.readInt();
                                shLevel = cmdData.readByte();
                                //资质
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 1] = cmdData.readByte();
                                //成长
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 2] = cmdData.readByte();
                                //状态
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 3] = cmdData.readByte();
                                //当前经验
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 4] = cmdData.readInt();
                                //最大经验
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 5] = cmdData.readInt();
                                //快乐度
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 6] = cmdData.readByte();
                                //当前潜能
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 7] = cmdData.readShort();
                                //最大潜能
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 8] = cmdData.readShort();
                                //智力
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 9] = cmdData.readInt();
                                //精力
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 10] = cmdData.readInt();
                                //力量
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 11] = cmdData.readInt();
                                //敏捷
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 12] = cmdData.readInt();
                                //宠物绑定状况
                                byBind = cmdData.readByte();
                                MainLogic.getInstance().uiInterFace.pet.items.addGoods((short) i, true, lGoodsKey, (short) 400, sGoodsName, (short) 1, iIconID, (byte) -1, (byte) (MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 1] + 1), (byte) -1, (byte) -1, byBind, null, shLevel, -1, (byte) -1, null);
                                //技能槽数量
                                MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 13] = cmdData.readByte();
                                //技能个数
                                bySkillNum = cmdData.readByte();
                                byte byPetSkillLock = 0;
                                String sSkillName;
                                for (j = 0; j < bySkillNum; j++) {
                                    //技能槽索引
                                    bySkillIndex = cmdData.readByte();
                                    Tools.printLog("i=" + i);
                                    Tools.printLog("bySkillIndex=" + bySkillIndex);
                                    //技能图片iD
                                    iIconID = cmdData.readInt();
                                    sSkillName = cmdData.readUTF();
                                    byLevel = cmdData.readByte();
                                    byPetSkillLock = cmdData.readByte();
                                    try {
                                        desc = cmdData.readUTF();
                                    } catch (Exception e) {
                                        desc = "技能描述出错了!";
                                    }
                                    //key组成,宠物索引+技能槽索引+类型(1,描述,2:图片)
                                    MainLogic.getInstance().uiInterFace.pet.setSkillHashTable((byte) i, bySkillIndex, iIconID, sSkillName, byLevel, byPetSkillLock, desc);
                                }
                                sSkillName = null;
                            }
                            desc = null;
                            sGoodsName = null;
                        }
                        MainLogic.getInstance().uiInterFace.pet.openPetEquip(byPlayerType == 2 ? true : false);
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "打开玩家宠物装备栏失败");
                    }
                    break;
                case Constant.MSG_NET_CMD_DELETE_PET:
                    stateCode = cmdData.readByte();
                    MainLogic.getInstance().uiInterFace.pet.delPetEquip(stateCode);
                    break;
                case Constant.MSG_NET_CMD_PET_FEED:
                    stateCode = cmdData.readByte();
                    if (stateCode == 1 || stateCode == 4) {
                        long lPetKey = cmdData.readLong();
                        byte byHappyDegree = cmdData.readByte();
                        MainLogic.getInstance().uiInterFace.pet.petFeed(stateCode, lPetKey, byHappyDegree);
                        if (GameBean.BL_PLAYER_HANGUP) {
                            if (byHappyDegree < 40)//喂养宠物
                            {
                                GameBean.L_CMD_PET_SLOTKEY = lPetKey;
                                GameBean.L_CMD_GOODS_SLOTKEY = 0;
                                MainLogic.getInstance().send(Constant.MSG_NET_CMD_PET_FEED, Constant.SOCKET_MSG_TYPE_LOGIC);
                            }
                        }
                    } else {
                        MainLogic.getInstance().uiInterFace.pet.petFeed(stateCode, -1, (byte) 0);
                    }
                    break;
                case Constant.MSG_NET_CMD_USE_PET:
                    stateCode = cmdData.readByte();
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    if (stateCode == 1) {
                        int shColomnIndex = cmdData.readInt();
                        MainLogic.getInstance().uiPackage.petPackageGoods.deleteGoods((short) shColomnIndex);
                        switch (MainLogic.getInstance().byGameState) {
                            case Constant.GAME_UI_PET_EQUIP:
                                GameBean.b_WAIT_NET_MSG_BACK = true;
                                MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_PET, Constant.SOCKET_MSG_TYPE_LOGIC);
                                MainLogic.getInstance().uiPackage.closeBag();
                                break;
                            default:
                                break;
                        }

                    } else if (stateCode == 0) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "宠物装备失败");
                    } else if (stateCode == 2) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "宠物栏已满，请先卸下其他宠物");
                    } else if (stateCode == 3) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您的等级不够，不可以装备该宠物");
                    }
                    break;
            }
    }

    public void processMessage3_2(int msgId, DataInputStream cmdData) throws IOException {
            int i, j;
            switch (msgId) {
            case Constant.MSG_NET_CMD_CHECK_PET:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                byte stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    StringBuffer sPetDetail = new StringBuffer("");
                    String sPetName = cmdData.readUTF();
                    sPetDetail.append("<l" + sPetName + ">     ");
                    byte byPetType = cmdData.readByte();
                    switch (byPetType) {
                        case 0:
                            sPetDetail.append("<m草食类>|");
                            break;
                        case 1:
                            sPetDetail.append("<m肉食类>|");
                            break;
                        case 2:
                            sPetDetail.append("<m杂食类>|");
                            break;
                    }
                    byte byLevel = cmdData.readByte();
                    sPetDetail.append("等级：" + byLevel + "|");
                    byte byQualification = cmdData.readByte();
                    switch (byQualification) {
                        case 0:
                            sPetDetail.append("品质：平凡|");
                            break;
                        case 1:
                            sPetDetail.append("品质：优秀|");
                            break;
                        case 2:
                            sPetDetail.append("品质：杰出|");
                            break;
                        case 3:
                            sPetDetail.append("品质：完美|");
                            break;
                    }
                    byte byGrowthRate = cmdData.readByte();
                    sPetDetail.append("|");
                    short intelligence = cmdData.readShort();//智力
                    short energy = cmdData.readShort();//精力
                    sPetDetail.append("智力：" + String.valueOf(intelligence) + "  精力：" + String.valueOf(energy) + "|");
                    short power = cmdData.readShort();//力量
                    short delicacy = cmdData.readShort();//灵敏
                    sPetDetail.append("力量：" + String.valueOf(power) + "  灵敏：" + String.valueOf(delicacy) + "|");
                    short cPotential = cmdData.readShort();//当前潜能
                    short mPotentia = cmdData.readShort();//最大潜能
                    sPetDetail.append("潜能：" + String.valueOf(cPotential) + "/" + String.valueOf(mPotentia) + "|");
                    byte bySkillNum = cmdData.readByte();
                    if (bySkillNum == 0) {
                        sPetDetail.append("技能：无");
                    } else {
                        sPetDetail.append("技能：");
                    }
                    String sSkillName;
                    byte bySkillLevel;
                    for (i = 0; i < bySkillNum; i++) {
                        sSkillName = cmdData.readUTF();
                        bySkillLevel = cmdData.readByte();
                        Tools.printLog(sSkillName);
                        sPetDetail.append(sSkillName + "(等级:" + bySkillLevel + ")     ");
                    }
                    MainLogic.getInstance().uiInterFace.sysMessage.openCheckPet(sPetDetail.toString(), byGrowthRate);
                    sPetDetail = null;
                    sSkillName = null;
                    sPetName = null;
                } else {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "宠物查看失败!");
                }
                break;
            case Constant.MSG_NET_CMD_FUNC_PET_COMPOSE:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    byte byPetDisapper = cmdData.readByte();
                    byte bySkillChangeNum = cmdData.readByte();
                    byte bySkillIndex;
                    byte byPetSkillLock;
                    String desc;
                    for (i = 0; i < bySkillChangeNum; i++) {
                        //技能槽索引
                        bySkillIndex = cmdData.readByte();
                        //技能图片iD
                        int iIconID = cmdData.readInt();
                        String sSkillName = cmdData.readUTF();
                        byte byLevel = cmdData.readByte();
                        byPetSkillLock = cmdData.readByte();
                        desc = cmdData.readUTF();
                        //key组成,宠物索引+技能槽索引+类型(1,描述,2:图片)
                        MainLogic.getInstance().uiInterFace.pet.sPetSkillNameDesc[bySkillIndex] = sSkillName + "|等级:" + byLevel;
                        MainLogic.getInstance().uiInterFace.pet.setSkillHashTable((byte) 0, bySkillIndex, iIconID, sSkillName, byLevel, byPetSkillLock, desc);
                    }
                    desc = null;
                    MainLogic.getInstance().uiInterFace.pet.completeCompose(stateCode, byPetDisapper, bySkillChangeNum);
                } else {
                    MainLogic.getInstance().uiInterFace.pet.completeCompose(stateCode, (byte) -1, (byte) -1);
                }
                break;
            case Constant.MSG_NET_CMD_OPT_ON_SCREEN:
                stateCode = cmdData.readByte();
                break;
            case Constant.MSG_NET_CMD_SELECT_PETCOMPOSE_ITEM:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    //等级合成等级
                    ///索引位置代表的意思:0:主宠的资质;1:主宠的成长;2:主宠的宠物槽数量;3:副宠的资质;4:副宠的成长;5:副宠的宠物槽数量;
                    byte byPetQuality = cmdData.readByte();
                    byte byPetGrowth = cmdData.readByte();
                    byte byPetSkillCoulmnNum = cmdData.readByte();
                    byte byPetSkillNum = cmdData.readByte();
                    byte bySkillIndex;
                    byte byPetSkillLock;
                    if (MainLogic.getInstance().uiInterFace.pet.items.checkColumnHasGoods((short) (MainLogic.getInstance().uiInterFace.pet.bySelectIndex - 1))) {
                        MainLogic.getInstance().uiInterFace.pet.removeSkillHash((byte) (MainLogic.getInstance().uiInterFace.pet.bySelectIndex - 1), (byte) MainLogic.getInstance().uiInterFace.pet.shPetState[(MainLogic.getInstance().uiInterFace.pet.bySelectIndex - 1) * 3 + 2], (byte) -1);
                        for (i = 0; i < 12; i++) {
                            MainLogic.getInstance().uiInterFace.pet.sPetSkillNameDesc[(MainLogic.getInstance().uiInterFace.pet.bySelectIndex - 1) * 12 + i] = null;
                        }
                    }
                    String sSkillName;
                    String desc;
                    for (i = 0; i < byPetSkillNum; i++) {
                        //技能槽索引
                        bySkillIndex = cmdData.readByte();
                        //技能图片iD
                        int iIconID = cmdData.readInt();
                        sSkillName = cmdData.readUTF();
                        byte byLevel = cmdData.readByte();
                        byPetSkillLock = cmdData.readByte();
                        try {
                            desc = cmdData.readUTF();
                        } catch (Exception e) {
                            desc = "技能描述出错了";
                        }
                        MainLogic.getInstance().uiInterFace.pet.sPetSkillNameDesc[(MainLogic.getInstance().uiInterFace.pet.bySelectIndex - 1) * 12 + bySkillIndex] = sSkillName + "|等级:" + byLevel;
                        //key组成,宠物索引+技能槽索引+类型(1,描述,2:图片)
                        MainLogic.getInstance().uiInterFace.pet.setSkillHashTable((byte) (MainLogic.getInstance().uiInterFace.pet.bySelectIndex - 1), bySkillIndex, iIconID, sSkillName, byLevel, byPetSkillLock, desc);
                    }
                    sSkillName = null;
                    desc = null;
                    MainLogic.getInstance().uiInterFace.pet.selectPetComposeItem(stateCode, MainLogic.getInstance().uiPackage.getCurrentPackage(), MainLogic.getInstance().uiPackage.shPos, byPetQuality, byPetGrowth, byPetSkillCoulmnNum);
                } else {
                    MainLogic.getInstance().uiInterFace.pet.selectPetComposeItem(stateCode, null, (short) -1, (byte) -1, (byte) -1, (byte) -1);
                }
                break;
            case Constant.MSG_NET_CMD_NPC_INFO:
                long npcid = cmdData.readLong();
                stateCode = cmdData.readByte();
                Tools.printLog("NPC类型：：：" + stateCode);
                if (stateCode == 2) {
                    int headId = cmdData.readInt();
                    Tools.printLog("头像ID：：" + headId);
                    MainLogic.addLockedInfor(npcid, -1, -1, -1, -1, -1, (byte) -1, headId);
                } else {
                    int lv = cmdData.readInt();
                    int iHp = cmdData.readInt();
                    int iMaxHp = cmdData.readInt();
                    int iMp = cmdData.readInt();
                    int iMaxMp = cmdData.readInt();
                    byte difficulty = cmdData.readByte();
                    int headId = cmdData.readInt();
                    MainLogic.addLockedInfor(npcid, lv, iMaxHp, iHp, iMaxMp, iMp, difficulty, headId);
                }
                break;
            case Constant.MSG_NET_CMD_OTHER_PLAYER_INFO:
                npcid = cmdData.readLong();
                int lv = cmdData.readInt();
                int iHp = cmdData.readInt();
                int iMaxHp = cmdData.readInt();
                int sprite = cmdData.readInt();
                int maxsprite = cmdData.readInt();
                byte sex = cmdData.readByte();
                byte otherPlayerDuty = cmdData.readByte();
                String tongNo = cmdData.readUTF();
                MainLogic.addLockedInfor(npcid, lv, iMaxHp, iHp, maxsprite, sprite, sex, otherPlayerDuty, tongNo);
                break;
            case Constant.MSG_NET_CMD_ADD_MONEY:
                int iMoney = cmdData.readInt();
                if (MainLogic.getInstance().uiEquipment != null) {
                    MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, "获得金钱" + Tools.moneyConvert(iMoney));
                }
                if (MainLogic.getInstance().uiPackage.bShowBAG) {
                    MainLogic.getInstance().uiPackage.lMoney += iMoney;
                } else {
                    switch (MainLogic.getInstance().byGameState) {
                        case Constant.GAME_UI_PACKAGE:
                            MainLogic.getInstance().uiPackage.lMoney += iMoney;
                            break;
                        case Constant.GAME_UI_PLAYER_STALL:
                            MainLogic.getInstance().uiInterFace.store.lMoney += iMoney;
                            break;
                    }
                }
                break;
            case Constant.MSG_NET_CMD_MOVE_ITEM:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    int index = cmdData.readInt();//索引
                    int num = cmdData.readInt();//成功数量
                    long lGoodsKey = cmdData.readLong();//槽KEY
                    MainLogic.getInstance().uiPackage.moveGoods((short) index, (short) num, lGoodsKey);
                } else {
                    MainLogic.getInstance().uiPackage.clearSpecialState();
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "物品移动失败");
                }
                break;
            case Constant.MSG_NET_MODIFY_POSITION:
                int playerX = cmdData.readInt();
                int playerY = cmdData.readInt();
                byte playerDirection = cmdData.readByte();
                MainLogic.getInstance().gamePlayer.updatePosition(playerX, playerY, Tools.getClientDirection(playerDirection));
                break;
            case Constant.MSG_NET_CMD_FUNC_HOLE:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                MainLogic.getInstance().uiInterFace.equipment.completeHole(stateCode);
                break;
            case Constant.MSG_NET_CMD_FUNC_HOLE_MONEY:
                stateCode = cmdData.readByte();
                long lMoney = 0;
                byte byGemType = 0;
                if (stateCode == 1) {
                    lMoney = cmdData.readLong();
                    byGemType = cmdData.readByte();
                }
                MainLogic.getInstance().uiInterFace.equipment.setHoleMoney(stateCode, lMoney, byGemType);
                break;
            case Constant.MSG_NET_CMD_FUNC_INLAY:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                String desc = null;
                if (stateCode == 1) {
                    String sGemKey = cmdData.readUTF();
                    String sGemName = cmdData.readUTF();
                    int iIconID = cmdData.readInt();
                    desc = cmdData.readUTF();
                    byte byColor = cmdData.readByte();
                    byte byLevel = cmdData.readByte();
                    MainLogic.getInstance().uiInterFace.equipment.completeInlay(stateCode, sGemKey, sGemName, iIconID, desc, byColor, byLevel);
                    sGemKey = null;
                    sGemName = null;
                    desc = null;
                } else {
                    MainLogic.getInstance().uiInterFace.equipment.completeInlay(stateCode, null, null, -1, null, (byte) -1, (byte) -1);
                }
                break;
            case Constant.MSG_NET_CMD_FUNC_STRENGTH:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                long money = 0L;
                if (stateCode == 1 || stateCode == 6) {
                    money = cmdData.readLong();
                    byte byStrengthenGemNum = cmdData.readByte();
                    byte byStrengthenLevel = cmdData.readByte();
                    short shStrengthenAddition = cmdData.readShort();
                    short shNextStrengthenAddition = cmdData.readShort();
                    MainLogic.getInstance().uiInterFace.equipment.completetItemsStrengthen(stateCode, money, byStrengthenGemNum, byStrengthenLevel, shStrengthenAddition, shNextStrengthenAddition);
                } else {
                    MainLogic.getInstance().uiInterFace.equipment.completetItemsStrengthen(stateCode, 0L, (byte) -1, (byte) -1, (short) 0, (short) 0);
                }
                break;
            case Constant.MSG_NET_CMD_FUNC_STRENGTH_RATE:
                stateCode = cmdData.readByte();
                short rate = 0;
                if (stateCode == 1) {
                    rate = cmdData.readShort();
                }
                MainLogic.getInstance().uiInterFace.equipment.setStrengthRate(stateCode, rate, MainLogic.getInstance().uiPackage.getCurrentPackage(), MainLogic.getInstance().uiPackage.shPos);
                break;
            case Constant.MSG_NET_CMD_ADD_FRIEND:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                long friendId = cmdData.readLong();//好友ID
                String friendName = cmdData.readUTF();//好友名字
                int friendLevel = cmdData.readInt();//好友级别
                String friendDuty = cmdData.readUTF();//好友职业
                int friendType = cmdData.readInt();//好友类型
                GameBean.BY_CMD_FRIEND_TYPE = friendType;
                switch (stateCode) {
                    case 0://成功
                        if (MainLogic.getInstance().byGameState == Constant.GAME_UI_FRIEND_LIST) {
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_FRIEND_LIST, Constant.SOCKET_MSG_TYPE_LOGIC);
                        }
                        switch (friendType) {
                            case 1://好友
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "添加好友成功", (byte) 1, (byte) -1);
                                break;
                            case 2://黑名单
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "添加黑名单成功", (byte) 1, (byte) -1);
                                break;
                            case 3://仇人
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "添加仇人成功", (byte) 1, (byte) -1);
                                break;
                            case 4://最近联系人
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "最近联系人添加成功", (byte) 1, (byte) -1);
                                break;
                        }
                        break;
                    case 1://超出上限
                        switch (friendType) {
                            case 1://好友
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "已超出好友人数上限", (byte) 1, (byte) -1);
                                break;
                            case 2://黑名单
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "已超出黑名单人数上限", (byte) 1, (byte) -1);
                                break;
                            case 3://仇人
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "已超出仇人人数上限", (byte) 1, (byte) -1);
                                break;
                            case 4://最近联系人
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "最近联系人人超过上限", (byte) 1, (byte) -1);
                                break;
                        }
                        break;
                    case 2://列表中已存在
                        switch (friendType) {
                            case 1://好友
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "该用户已存在好友列表中", (byte) 1, (byte) -1);
                                break;
                            case 2://黑名单
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "该用户已存在黑名单列表中", (byte) 1, (byte) -1);
                                break;
                            case 3://仇人
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "该用户已存在仇人列表中", (byte) 1, (byte) -1);
                                break;
                            case 4://最近联系人
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "该用户已存在最近联系人表中", (byte) 1, (byte) -1);
                                break;
                        }
                        break;
                    case 3://用户名不存在
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "你所添加的用户名不存在", (byte) 1, (byte) -1);
                        break;
                    case 4://不能添加自己
                        switch (friendType) {
                            case 1://好友
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不能添加自己为好友", (byte) 1, (byte) -1);
                                break;
                            case 2://黑名单
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不能把自己加入黑名单", (byte) 1, (byte) -1);
                                break;
                            case 3://仇人
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不能添加自己为仇人", (byte) 1, (byte) -1);
                                break;
                            case 4://最近联系人
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不能添加自己", (byte) 1, (byte) -1);
                                break;
                        }
                }
                friendName = null;
                friendDuty = null;
                break;
            case Constant.MSG_NET_CMD_BE_ADD_FRIEND:
                GameBean.BY_CMD_FRIEND_NAME = cmdData.readUTF();
                GameBean.BY_CMD_FRIEND_MODE = 2;
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "玩家" + GameBean.BY_CMD_FRIEND_NAME + "添加您为好友，你是否添加对方为好友", (byte) 0, Constant.GAME_UI_ROAM);
                break;
            case Constant.MSG_NET_CMD_FRIEND_LIST://好友列表
                GameBean.b_WAIT_NET_MSG_BACK = false;
                friendType = cmdData.readInt();//好友类型
                GameBean.BY_CMD_FRIEND_TYPE = friendType;
                int friendNum = cmdData.readInt();
                MainLogic.getInstance().uiInterFace.friend.init(friendNum);//好友人数
                byte friendOnline = -1;
                for (i = 0; i < friendNum; i++) {
                    friendId = cmdData.readLong();//好友ID
                    friendName = cmdData.readUTF();//好友名字
                    friendLevel = cmdData.readInt();//好友级别
                    friendDuty = cmdData.readUTF();//职业
                    friendOnline = cmdData.readByte();//是否在线
                    MainLogic.getInstance().uiInterFace.friend.init(i, friendId, friendName, friendLevel, friendDuty, friendOnline);
                }
                friendName = null;
                friendDuty = null;
                MainLogic.getInstance().pushState(Constant.GAME_UI_FRIEND_LIST, true);
                break;
            case Constant.MSG_NET_CMD_DEL_FREIND://读取删除好友
                GameBean.b_WAIT_NET_MSG_BACK = false;
                friendType = cmdData.read();//删除类型
                GameBean.BY_CMD_FRIEND_TYPE = friendType;
                stateCode = cmdData.readByte();//删除结果
                if (MainLogic.getInstance().byGameState == Constant.GAME_UI_FRIEND_LIST) {
                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_FRIEND_LIST, Constant.SOCKET_MSG_TYPE_LOGIC);
                }
                switch (friendType) {
                    case 1:
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "删除好友成功", (byte) 1, (byte) -1);
                        break;
                    case 2:
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "删除黑名单成功", (byte) 1, (byte) -1);
                        break;
                    case 3:
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "删除仇人成功", (byte) 1, (byte) -1);
                        break;
                }
                break;
            case Constant.MSG_NET_CMD_OPEN_NPC_STORE:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    byte byNpcStoreType = cmdData.readByte();
                    int[] iBrandPrice = null;
                    int iTongEmblem = 0;
                    int iDragonEye = 0;
                    int iStar = 0;
                    int iPhenixEye = 0;
                    int iSevenKill = 0;
                    lMoney = 0;
                    String sShopTitle = cmdData.readUTF();
//                    System.out.println("sShopTitle " + sShopTitle);
                    if (byNpcStoreType == 4
                            || byNpcStoreType == 5
                            || byNpcStoreType == 6) {
                        int shStroeGoodsNum = cmdData.readInt();
//                        System.out.println("shStroeGoodsNum " + shStroeGoodsNum);
                        MainLogic.getInstance().uiEquipment.Exchangenum = shStroeGoodsNum;
                        MainLogic.getInstance().uiEquipment.Exchange = new String[shStroeGoodsNum][6];
                        short shLevel;
                        String description = "";
                        for (i = 0; i < shStroeGoodsNum; i++) {
                            String sGoodsKey = cmdData.readUTF();
//                            System.out.println("sGoodsKey " + sGoodsKey);
                            String sGoodsName = cmdData.readUTF();
//                            System.out.println("sGoodsName " + sGoodsName);
                            shLevel = cmdData.readShort();
//                            System.out.println("shLevel " + shLevel);
                            description = cmdData.readUTF();
//                            System.out.println("description " + description);
                            MainLogic.getInstance().uiEquipment.getExchange(i, sShopTitle, sGoodsKey,
                                    sGoodsName, "" + shLevel, description, "" + byNpcStoreType);
                        }
                        MainLogic.getInstance().uiInterFace.store.byStoreType = byNpcStoreType;
                        MainLogic.getInstance().pushState(Constant.GAME_UI_EXCHANGE, true);
                    } else {
                        switch (byNpcStoreType) {
                            case 1:
                                lMoney = cmdData.readLong();
                                break;
                            case 2:
                                iDragonEye = cmdData.readInt();
                                iStar = cmdData.readInt();
                                iPhenixEye = cmdData.readInt();
                                iSevenKill = cmdData.readInt();
                                break;
                            case 3:
                                iTongEmblem = cmdData.readInt();
                                break;
                        }
                        int shStroeGoodsNum = cmdData.readInt();
                        if (byNpcStoreType == 2 && shStroeGoodsNum > 0) {
                            iBrandPrice = new int[shStroeGoodsNum * 4];
                        }
                        MainLogic.getInstance().uiInterFace.store.items = new Goods((short) shStroeGoodsNum, Constant.ITEM_COLUMN_TYPE_STORE);
                        int iPrice = 0;
                        short shLevel;
                        byte job, bySex;
                        for (i = 0; i < shStroeGoodsNum; i++) {
                        	String sGoodsKey = cmdData.readUTF();
                        	String sGoodsName = cmdData.readUTF();
                            int iIconID = cmdData.readInt();
                            byte byColor = cmdData.readByte();
                            shLevel = cmdData.readShort();
                            byte byJob = cmdData.readByte();
                            bySex = cmdData.readByte();
                            switch (byNpcStoreType) {
                                case 1:
                                    iPrice = cmdData.readInt();
                                    break;
                                case 2:
                                    iBrandPrice[i * 4 + 0] = cmdData.readShort();
                                    iBrandPrice[i * 4 + 1] = cmdData.readShort();
                                    iBrandPrice[i * 4 + 2] = cmdData.readShort();
                                    iBrandPrice[i * 4 + 3] = cmdData.readShort();
                                    iPrice = -1;
                                    break;
                                case 3:
                                    iPrice = cmdData.readInt();
                                    break;
                            }
                            MainLogic.getInstance().uiInterFace.store.items.addGoods((short) i, true, -1L, (byte) -1, sGoodsName, (short) 1, iIconID, (byte) -1, byColor, byJob, bySex, (byte) -1, null, shLevel, iPrice, (byte) -1, sGoodsKey);
                        }
                        MainLogic.getInstance().uiInterFace.store.setNpcStore(byNpcStoreType, sShopTitle, lMoney, iTongEmblem, iDragonEye, iStar, iPhenixEye, iSevenKill, iBrandPrice);
                        iBrandPrice = null;
                        sShopTitle = null;
//                        String sGoodsName = null;
                    }
                } else if (stateCode == 2) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不能在非本帮派的帮派家园中打开商店!");
                } else {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "NPC商店打开失败!");
                }
                break;
            case Constant.MSG_NET_CMD_CHECK_STORE_ITEM:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    Vector sVector = new Vector();
                    String[] sGoodsDetail = null;
                    byte byGoodsLevel = cmdData.readByte();
                    sVector.addElement("物品等级:" + byGoodsLevel);
                    byte byJob = cmdData.readByte();
                    if (byJob > 0) {
                        sVector.addElement("职业要求:" + Tools.getJobName(byJob));
                    } else {
                        sVector.addElement("职业要求:无");
                    }
                    int iPirce = cmdData.readInt();
                    sVector.addElement("售价:" + Tools.moneyConvert(iPirce));
                    byte byDecsNum = cmdData.readByte();
                    String temp;
                    if (byDecsNum > 0) {
                        for (short p = 0; p < byDecsNum; p++) {
                            temp = cmdData.readUTF();
                            sVector.addElement(temp);
                        }
                        temp = null;
                    }
                    desc = cmdData.readUTF();
                    byte byBindType = cmdData.readByte();
                    Tools.printLog("byBindType=" + byBindType);
                    if (byBindType == 0) {
                        sVector.addElement("绑定:不绑定");
                    } else if (byBindType == 1) {
                        sVector.addElement("绑定:使用后绑定");
                    } else if (byBindType == 2) {
                        sVector.addElement("绑定:拾取后绑定");
                    } else if (byBindType == 3) {
                        sVector.addElement("绑定:使用绑定道具后绑定");
                    }
                    byte bySet = cmdData.readByte();
                    if (bySet == 1) {
                        sVector.addElement("套装效果: ");
                        byte bySetNum = cmdData.readByte();
                        Tools.printLog("bySetNum=" + bySetNum);
                        for (i = 0; i < bySetNum; i++) {
                            temp = cmdData.readUTF();
                            sVector.addElement("<e(" + String.valueOf(i + 1) + "件)" + temp);
                        }
                        temp = null;
                    }
                    sGoodsDetail = new String[sVector.size()];
                    sVector.copyInto(sGoodsDetail);
                    sVector = null;
                    temp = null;
                    MainLogic.getInstance().uiInterFace.sysMessage.openCheckItem(sGoodsDetail, desc, false, (byte) -1, (byte) -1);
                    sGoodsDetail = null;
                    desc = null;
                } else {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "查看物品失败");
                }
                break;
            case Constant.MSG_NET_CMD_CHECK_STORE_DESC:
                stateCode = cmdData.readByte();
                MainLogic.getInstance().uiInterFace.store.bWaitMSGBack = false;
                if (stateCode == 1) {
                    desc = cmdData.readUTF();
                    if (MainLogic.getInstance().uiPackage.bShowBAG || MainLogic.getInstance().byGameState == Constant.GAME_UI_PACKAGE) {
                        MainLogic.getInstance().uiPackage.setGoodsDescFromNet(desc);
                    } else {
                        MainLogic.getInstance().uiInterFace.store.setGoodsDescFromNet(desc);
                    }
                }
                break;}

    }

    /////////yj1
    public void processMessage1(int msgId, DataInputStream cmdData) {
    	

		try {
			processMessage1_1(msgId, cmdData);
			processMessage1_2(msgId, cmdData);
		} catch (Exception e) {
			e.printStackTrace();
		}
    }

    public void processMessage1_1(int msgId, DataInputStream cmdData) 
    {

        try {
            byte stateCode;
            switch (msgId) {
                case Constant.MSG_NET_CMD_NPC_CHANGE:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    stateCode = cmdData.readByte();
                    if (stateCode == 0)//失败
                    {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "NPC变身失败!");
                    } else if (stateCode == 1) {
                        MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                    }
                    break;
                case Constant.MSG_NET_LEARN_SKILL:
                    //学习技能
                    stateCode = cmdData.readByte();
                    if (stateCode == 1) {
                        byte byPlayerSkillType;
                        int iPlayerCoolTime;
                        String sPlayerSkillKey = cmdData.readUTF();
                        int iPlayerSkillskillID = cmdData.readInt();
                        String shPlayerSkillActID = cmdData.readUTF();
                        byPlayerSkillType = cmdData.readByte();
                        iPlayerCoolTime = cmdData.readInt();
                        int skillDistance = cmdData.readInt();
                        int skillMp = cmdData.readInt();
                        byte skillAttackType = cmdData.readByte();
                        String sSkillName = cmdData.readUTF();
                        int iValue = cmdData.readInt();
                        int iGangValue = cmdData.readInt();
                        MainLogic.getInstance().gamePlayer.addOnePlayerSkill(1, sPlayerSkillKey, byPlayerSkillType, iPlayerSkillskillID,
                                shPlayerSkillActID, iPlayerCoolTime, skillDistance, skillMp, skillAttackType);
                        String tips = "成功学习技能“" + sSkillName + "”";
                        if (Math.abs(iValue) != 0) {
                            tips += ",消耗修为“" + Math.abs(iValue) + "”点";
                        }
                        if (Math.abs(iGangValue) != 0) {
                            tips += ",消耗帮贡“" + Math.abs(iGangValue) + "”点";
                        }
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", tips);
                        sPlayerSkillKey = null;
                        shPlayerSkillActID = null;
                    } else if (stateCode == 2) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您的等级不够，无法学习该技能!");
                    } else if (stateCode == 3) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您的职业不能学习这个技能!");
                    } else if (stateCode == 4) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您的修为值不够，无法学习该技能!");
                    } else if (stateCode == 5) {
                        Tools.printLog("学习技能等级错误");
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您的技能等级不够!");
                    } else if (stateCode == 6) {
                        Tools.printLog("心法位已满");
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "心法位已满!");
                    } else if (stateCode == 7) {
                        Tools.printLog("已经学了该技能");
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您已经学了该技能!");
                    } else if (stateCode == 8) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您的帮贡值不够，无法学习该技能!!");
                    } else {
                        Tools.printLog("技能学习失败");
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不满足技能学习条件，学习失败!");
                    }
                    break;
                case Constant.MSG_NET_ADD_SKILL_PLACE:
                    //添加技能心法位
                    stateCode = cmdData.readByte();
                    if (stateCode == 1) {
                        Tools.printLog("添加技能心法位成功");
                    } else {
                        Tools.printLog("添加技能心法位失败");
                    }
                    break;
                case Constant.MSG_NET_UNLEARN_SKILL:
                    //遗忘技能
                    stateCode = cmdData.readByte();
                    if (stateCode == 1) {
                        MainLogic.getInstance().uiEquipment.delKungfu(MainLogic.getInstance().uiEquipment.delkungfu_id);
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "技能遗忘成功!");
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "技能遗忘失败!");
                    }
                    break;
                case Constant.MSG_NET_CLEAN_MERIDIAN:
                    //洗点
                    stateCode = cmdData.readByte();
                    if (stateCode == 0) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "洗点失败!");
                    } else if (stateCode == 1) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "洗点成功!");
                    }
                    break;
                //npc交流命令
                case Constant.MSG_NET_CMD_NPC:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    MainLogic.getInstance().bSendLockedNpcInfo = false;
                    if (MainLogic.getInstance().uiInterFace.sRoamMapKeys.equals("10201")) {
                        return;
                    }
                    if (Constant.DEBUG) {
                        MainCanvas.addLog("接受到打开npcd对界面");
                    }
                    byte byMissiontype = 0;
                    String strContent = null;
                    long npcId = cmdData.readLong();
                    byte cmdtype = cmdData.readByte();
                    int j = 0;
                    short missionNums = 0;
                    short cmdNums = 0;
                    String[] sNPCTaskArray = null;
                    String[] sNPCFuncArray = null;
                    byte[] byTaskState = null;
                    if (cmdtype == 0) {
                        MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                        break;
                    }
                    //有谈话内容
                    if (cmdtype == 1 || cmdtype == 3 || cmdtype == 5 || cmdtype == 7) {
                        strContent = cmdData.readUTF();
                    }

                    //有功能的
                    if (cmdtype == 2 || cmdtype == 3 || cmdtype == 6 || cmdtype == 7) {
                        cmdNums = cmdData.readShort();
                        sNPCFuncArray = new String[cmdNums * 2];
                        for (j = cmdNums - 1; j >= 0; j--) {
                            sNPCFuncArray[2 * j] = cmdData.readUTF();
                            sNPCFuncArray[2 * j + 1] = cmdData.readUTF();
                        }

                    }
                    //有任务的
                    if (cmdtype == 4 || cmdtype == 5 || cmdtype == 6 || cmdtype == 7) {
                        missionNums = cmdData.readShort();
                        sNPCTaskArray = new String[missionNums * 2];
                        byTaskState = new byte[missionNums];
                        for (j = 0; j < missionNums; j++) {
                            sNPCTaskArray[2 * j] = cmdData.readUTF();
                            sNPCTaskArray[2 * j + 1] = cmdData.readUTF();
                            byTaskState[j] = cmdData.readByte();
                        }
                    }
                    MainLogic.getInstance().uiInterFace.npcTalk.setNPCTalk(npcId, strContent, sNPCFuncArray, sNPCTaskArray, byTaskState);
                    strContent = null;
                    sNPCTaskArray = null;
                    sNPCFuncArray = null;
                    byTaskState = null;
                    break;
                case Constant.MSG_NET_CMD_QUEST:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    if (Constant.DEBUG) {
                        MainCanvas.addLog("接受到打开任务界面");
                    }
                    short subType = cmdData.readShort();
                    if (subType == 0) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "任务异常，请联系GM!");
                        break;
                    }
                    //接受查询和归还任务
                    String missionNote = null;
                    String missionObj = null;
                    String missionName = null;
                    int goodsNums = 0;
                    short goodsTypeNums = 0;
                    long lNpcId = 0;
                    long lMoney = 0L;
                    byte byItemChoiceStyle = 0;
                    int xp = 0;
                    int skillValue = 0;
                    short shTaskLevel = 0;

                    byte byMissionType = 0;
                    if (subType == 1) {
                        lNpcId = cmdData.readLong();//npcID
                        missionName = cmdData.readUTF(); // 任务名称
                        byMissionType = cmdData.readByte();//任务类型
                        shTaskLevel = cmdData.readShort();//任务的等级
                        missionNote = cmdData.readUTF();//任务描述
                        lMoney = cmdData.readLong();//奖励金钱
                        int iExp = cmdData.readInt();//奖励经验
                        int iPower = cmdData.readInt(); //奖励修为
                        short shSendStoneNum = cmdData.readShort(); //背包中传送石头的个数
                        byItemChoiceStyle = cmdData.readByte(); // 任务物品奖励类型
                        byte byHasJobLimit = cmdData.readByte();//任务是否有职业限制
                        goodsTypeNums = cmdData.readShort(); //奖励的物品数量
                        String sGoodsKey = null;
                        String sGoodsName = null;
                        int iIconID;
                        byte byLevel;
                        int iStackNum;
                        byte byColor = 0;
                        byte byJob = -1;
                        byte byBind = 0;
                        if (goodsTypeNums > 0) {
                            MainLogic.getInstance().uiInterFace.npcTalk.items = new Goods(goodsTypeNums, Constant.ITEM_COLUMN_TYPE_COMMON);
                            for (j = 0; j < goodsTypeNums; j++) {
                                sGoodsKey = cmdData.readUTF(); //物品的ID
                                sGoodsName = cmdData.readUTF();
                                iIconID = cmdData.readShort();
                                byLevel = cmdData.readByte();
                                iStackNum = cmdData.readInt();
                                byColor = cmdData.readByte(); //奖励物品品质颜色
                                byJob = cmdData.readByte();//物品的职业限制
                                byBind = cmdData.readByte();//物品的绑定类型
                                MainLogic.getInstance().uiInterFace.npcTalk.items.addGoods((short) j, true, -1L, (short) -1, sGoodsName, (short) iStackNum, Math.abs(iIconID), (byte) -1, byColor, byJob, (byte) -1, byBind, null, (short) -1, -1, (byte) -1, sGoodsKey);
                            }
                            sGoodsKey = null;
                            sGoodsName = null;
                        }
                        MainLogic.getInstance().uiInterFace.npcTalk.setTask((byte) 1, lNpcId, missionName, missionNote, lMoney, iExp, iPower, byItemChoiceStyle, shSendStoneNum, (byte) 0, shTaskLevel, byHasJobLimit, byMissionType);
                        sGoodsKey = null;
                        sGoodsName = null;
                    } else if (subType == 3) {
                        //任务奖励提示
                        lNpcId = cmdData.readLong();
                        missionNote = cmdData.readUTF();
                        String missionKey = cmdData.readUTF();
                        shTaskLevel = cmdData.readShort();//任务等级
                        missionName = cmdData.readUTF();
                        byItemChoiceStyle = cmdData.readByte(); // 任务物品奖励类型
                        byte byHasJobLimit = cmdData.readByte();//任务是否有职业限制
                        lMoney = cmdData.readLong();//奖励金钱
                        int iExp = cmdData.readInt();//奖励经验
                        int iPower = cmdData.readInt(); //奖励修为
                        goodsTypeNums = cmdData.readShort();
                        String sGoodsKey = null;
                        String sGoodsName = null;
                        int iIconID;
                        byte byLevel;
                        int iStackNum;
                        byte byJob;
                        byte byBind;
                        byte byColor = -1;
                        if (goodsTypeNums > 0) {
                            MainLogic.getInstance().uiInterFace.npcTalk.items = new Goods(goodsTypeNums, Constant.ITEM_COLUMN_TYPE_COMMON);
                            for (j = 0; j < goodsTypeNums; j++) {
                                sGoodsKey = cmdData.readUTF();
                                sGoodsName = cmdData.readUTF();
                                iIconID = cmdData.readShort();
                                byLevel = cmdData.readByte();
                                iStackNum = cmdData.readInt();
                                byColor = cmdData.readByte();
                                byJob = cmdData.readByte();//物品的职业限制
                                byBind = cmdData.readByte();//物品绑定类型
                                MainLogic.getInstance().uiInterFace.npcTalk.items.addGoods((short) j, true, -1L, (short) -1, sGoodsName, (short) iStackNum, Math.abs(iIconID), (byte) -1, byColor, byJob, (byte) -1, byBind, null, (short) -1, -1, (byte) -1, sGoodsKey);
                            }
                        }
                        MainLogic.getInstance().uiInterFace.npcTalk.setTask(lNpcId, missionName, missionNote, lMoney, iExp, iPower, byItemChoiceStyle, shTaskLevel, byHasJobLimit);
                        sGoodsKey = null;
                        sGoodsName = null;
                        missionKey = null;
                    }
                    missionNote = null;
                    missionObj = null;
                    missionName = null;
                    break;
                case Constant.MSG_NET_XCHANGE_SCENE:
                    //状态(byte) 1	场景key(变长字符串)	地形资源id( 4byte)// 2 玩家位置x(4byte)	玩家位置y(4byte)
                    stateCode = cmdData.readByte();
                    //地图切换时锁定，解锁
                    MainLogic.getInstance().gamePlayer.bChangeSceneLock = false;
                    if (stateCode == 1) {//等级不够
                        if (!MainLogic.getInstance().gamePlayer.bPopUp) {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "等级不够", (byte) 1, (byte) -1);
                            MainLogic.getInstance().gamePlayer.bPopUp = true;
                        }
                    } else if (stateCode == 2) {//副本提示
                        Tools.printLog("副本提示");
                        String sceneKey = cmdData.readUTF();
                        short x = cmdData.readShort();
                        short y = cmdData.readShort();
                        GameBean.STR_SCENCE_KEY = sceneKey;
                        GameBean.i_SEND_POS_X = x;
                        GameBean.i_SEND_POS_Y = y;
                        if (!MainLogic.getInstance().gamePlayer.bPopUp) {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "副本将重置", (byte) 0, Constant.GAME_UI_ROAM);
                            GameBean.BY_SCENE_POPUP = 1;
                        }
                    }
                    break;
                case Constant.MSG_NET_CMD_OPEN_BAG:
                //排序物品
                case Constant.MSG_NET_CMD_SORT_ITEM:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    stateCode = cmdData.readByte();
                    if (stateCode == 1) {
                        //普通包裹栏界面
                        int iColumnIndex;
                        long lColumnKey;
                        short shGoodsType;
                        String sGoodsName;
                        short shGoodsNum;
                        int iGoodsIconID;
                        short shGoodsLevel;
                        byte byEquipmentPos;
                        byte byGoodsColor;
                        byte byGoodsJob;
                        byte byGoodsGender;
                        byte bybind;
                        int price;
                        byte byDurability;
                        String sGoodsKey;
                        byte byColumnType = cmdData.readByte();
                        short shMaxColumnNum = cmdData.readShort();//最大包裹栏数量
                        short shColumnNum = cmdData.readShort();//玩家物品数量
                        MainLogic.getInstance().uiPackage.setBagData(byColumnType, shMaxColumnNum);
                        for (int n = 0; n < shColumnNum; n++) {
                            iColumnIndex = cmdData.readInt();
                            lColumnKey = cmdData.readLong();
                            shGoodsType = cmdData.readShort();
                            sGoodsName = cmdData.readUTF();
                            shGoodsNum = cmdData.readShort();
                            iGoodsIconID = cmdData.readInt();
                            shGoodsLevel = cmdData.readShort();
                            byEquipmentPos = cmdData.readByte();
                            byGoodsColor = cmdData.readByte();
                            byGoodsJob = cmdData.readByte();
                            byGoodsGender = cmdData.readByte();
                            bybind = cmdData.readByte();
                            price = cmdData.readInt();
                            byDurability = cmdData.readByte();
                            sGoodsKey = cmdData.readUTF();
                            switch (byColumnType) {
                                case Constant.ITEM_COLUMN_TYPE_COMMON:
                                    MainLogic.getInstance().uiPackage.packageGoods.addGoods((short) iColumnIndex, true, lColumnKey, shGoodsType, sGoodsName, shGoodsNum, iGoodsIconID, byEquipmentPos, byGoodsColor, byGoodsJob, byGoodsGender, bybind, null, shGoodsLevel, price, byDurability, sGoodsKey);
                                    break;
                                case Constant.ITEM_COLUMN_TYPE_TASK:
                                    MainLogic.getInstance().uiPackage.taskPackageGoods.addGoods((short) iColumnIndex, true, lColumnKey, shGoodsType, sGoodsName, shGoodsNum, iGoodsIconID, byEquipmentPos, byGoodsColor, byGoodsJob, byGoodsGender, bybind, null, shGoodsLevel, price, byDurability, sGoodsKey);
                                    break;
                                case Constant.ITEM_COLUMN_TYPE_PET:
                                    MainLogic.getInstance().uiPackage.petPackageGoods.addGoods((short) iColumnIndex, true, lColumnKey, shGoodsType, sGoodsName, shGoodsNum, iGoodsIconID, byEquipmentPos, byGoodsColor, byGoodsJob, byGoodsGender, bybind, null, shGoodsLevel, price, byDurability, sGoodsKey);
                                    break;
                            }
                        }
                        sGoodsKey = null;
                        sGoodsName = null;
                        MainLogic.getInstance().uiPackage.lMoney = cmdData.readLong();
                        MainLogic.getInstance().uiPackage.setGoodsState();
                    } else {
                        if (!MainLogic.getInstance().uiPackage.bSendShowBag) {
                            MainLogic.getInstance().uiPackage.bSendShowBag = false;
                        }
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "打开背包失败");
                    }
                    break;
                case Constant.MSG_NET_CMD_PUT_ITEM:
                    byte byColumnType = cmdData.readByte();
                    int iColumnIndex = cmdData.readInt();
                    long lColumnKey = cmdData.readLong();
                    short shGoodsType = cmdData.readShort();
                    String sGoodsName = cmdData.readUTF();
                    short shGoodsNum = cmdData.readShort();
                    int iGoodsIconID = cmdData.readInt();
                    short shGoodsLevel = cmdData.readShort();
                    byte byEquipmentPos = cmdData.readByte();
                    byte byGoodsColor = cmdData.readByte();
                    byte byGoodsJob = cmdData.readByte();
                    byte byGoodsGender = cmdData.readByte();
                    byte bybind = cmdData.readByte();
                    int price = cmdData.readInt();
                    byte byDurability = cmdData.readByte();
                    String sGoodsKey = cmdData.readUTF();
                    if (MainLogic.getInstance().byGameState == Constant.GAME_UI_PACKAGE || MainLogic.getInstance().uiPackage.bShowBAG) {
                        switch (byColumnType) {
                            case 1:
                                if (MainLogic.getInstance().uiPackage.packageGoods != null) {
                                    MainLogic.getInstance().uiPackage.packageGoods.addGoods((short) iColumnIndex, true, lColumnKey, shGoodsType, sGoodsName, shGoodsNum, iGoodsIconID, byEquipmentPos, byGoodsColor, byGoodsJob, byGoodsGender, bybind, null, shGoodsLevel, price, byDurability, sGoodsKey);
                                }
                                break;
                            case 2:
                                if (MainLogic.getInstance().uiPackage.taskPackageGoods != null) {
                                    MainLogic.getInstance().uiPackage.taskPackageGoods.addGoods((short) iColumnIndex, true, lColumnKey, shGoodsType, sGoodsName, shGoodsNum, iGoodsIconID, byEquipmentPos, byGoodsColor, byGoodsJob, byGoodsGender, bybind, null, shGoodsLevel, price, byDurability, sGoodsKey);
                                }
                                break;
                            case 3:
                                if (MainLogic.getInstance().uiPackage.petPackageGoods != null) {
                                    MainLogic.getInstance().uiPackage.petPackageGoods.addGoods((short) iColumnIndex, true, lColumnKey, shGoodsType, sGoodsName, shGoodsNum, iGoodsIconID, byEquipmentPos, byGoodsColor, byGoodsJob, byGoodsGender, bybind, null, shGoodsLevel, price, byDurability, sGoodsKey);
                                }
                                break;
                        }
                    }
                    sGoodsName = null;
                    break;
                case Constant.MSG_NET_CMD_ADD_ITEM:
                    //添加物品
                    short shStrItemNum = cmdData.readShort();
                    if (shStrItemNum > 0) {
                        String[] strItem;
                        strItem = new String[shStrItemNum];
                        for (short p = 0; p < shStrItemNum; p++) {
                            strItem[p] = cmdData.readUTF();
                            if (!strItem[p].equals("")) {
                                MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, strItem[p]);
                            }
                        }
                        strItem = null;
                    }
                    byte warningState = cmdData.readByte();
                    //警告信息，物品栏已满或是临时物品栏已满
                    if (warningState == 1) {
                        String strWarning = cmdData.readUTF();
                        if (MainLogic.getInstance().uiEquipment != null) {
                            MainLogic.getInstance().uiEquipment.getChatInformation(100,
                                    "", (byte) 5, "警告:" + strWarning);
                        }
                        strWarning = null;
                    }
                    break;
                case Constant.MSG_NET_CMD_DELETE_ITEM:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    //删除物品
                    int index;
                    stateCode = cmdData.readByte();
                    if (stateCode == 1) {
                        switch (MainLogic.getInstance().byGameState) {
                            case Constant.GAME_UI_PACKAGE:
                                index = cmdData.readInt();
                                MainLogic.getInstance().uiPackage.deleteGoods((short) index);
                                break;
                            case Constant.GAME_UI_EQUIPMENT:
                                MainLogic.getInstance().uiPackage.packageGoods.deleteGoods(MainLogic.getInstance().uiPackage.shPos);
                                break;
                        }
                    } else if (stateCode == 2) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您不可以丢弃该物品!");
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "物品删除失败");
                    }
                    break;
                case Constant.MSG_NET_CMD_USE_ITEM:
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    stateCode = cmdData.readByte();
                    String temp = null;
                    switch (stateCode) {
                        case 0:
                            if (GameBean.SH_GOODS_TYPE == Constant.ITEM_COLUMN_TYPE_EQUIP || GameBean.SH_GOODS_TYPE == Constant.ITEM_COLUMN_TYPE_WAREHOUSE) {
                                temp = "不符合装备条件，无法佩戴该装备!";
                            } else if (GameBean.SH_GOODS_TYPE == Constant.ITEM_TYPE_MEDICINE) {
                                temp = "道具使用失败！";
                            } else if (GameBean.SH_GOODS_TYPE == Constant.ITEM_TYPE_SKILLS_BOOKS) {
                                temp = "不满足技能学习条件，学习失败。！";
                            } else {
                                temp = "道具使用失败!";
                            }
                            break;
                        case 1:
                            if (GameBean.SH_GOODS_TYPE == Constant.ITEM_COLUMN_TYPE_EQUIP || GameBean.SH_GOODS_TYPE == Constant.ITEM_COLUMN_TYPE_WAREHOUSE) {
                                temp = "";
                            } else if (GameBean.SH_GOODS_TYPE == Constant.ITEM_TYPE_MEDICINE) {
                                temp = "道具使用成功！";
                            } else if (GameBean.SH_GOODS_TYPE == Constant.ITEM_TYPE_SKILLS_BOOKS) {
                                temp = "";
                            } else {
                                temp = "道具使用成功!";
                            }
                            break;
                        case 2:
                            temp = "您没有足够的背包空间!";
                            break;
                        case 3:
                            temp = "您的等级不够，不能使用!!";
                            break;
                        case 4:
                            temp = "宠物蛋开启失败,您的宠物包裹栏已满!";
                            break;
                        case 6:
                            temp = "使用失败，心法格已满!";
                            break;
                        case 7:
                            //temp = "您身上已经有最多5张经验卡效果了!";
                            temp = "道具使用失败，您身上已经有类似的buff效果了!";
                            break;
                        case 8:
                            temp = "物品还没有冷却!";
                            break;
                        case 9:
                            temp = "您没有精铁宝箱钥匙!";
                            break;
                        case 10:
                            temp = "心法栏扩展成功！";
                            break;
                        case 11:
                            temp = "您身上已经有其他经验卡效果了";
                            break;
                        case 12:
                            temp = "使用成功，您将触发一个任务!";
                            break;
                        case 13:
                            temp = "使用失败，物品栏已达到开启上限!";
                            break;
                        case 14:
                            temp = "您现在不用使用药品!";
                            break;
                        case 15:
                            temp = "";
                            break;
                        case 16:
                            temp = "";
                            break;
                        default:
                            temp = "未知错误！";
                            break;
                    }
                    Player.iHangUpUseGoodsLock = false;
                    if (stateCode == 1 || stateCode == 5 || stateCode == 10 || stateCode == 12 || stateCode == 15 || stateCode == 16) {
                        byColumnType = cmdData.readByte();
                        iColumnIndex = cmdData.readInt();
                        long lGoodsKey = cmdData.readLong();
                        for (int i = 0; i < 9; i++) {
                            if (MainLogic.getInstance().getQuickSetType(i) == 2) {
                                if (Long.parseLong(MainLogic.getInstance().uiInterFace.gameSet.QuickSet[i][3]) == lGoodsKey) {
                                    MainLogic.getInstance().uiInterFace.gameSet.quickSetTime[i][0] = System.currentTimeMillis();
                                }
                            }
                        }
                        shGoodsNum = cmdData.readShort();
                        if (GameBean.BL_PLAYER_HANGUP && shGoodsNum == 0) {
                            Property.deleteHangUpGoods(lGoodsKey);
                        }
                        switch (MainLogic.getInstance().byGameState) {
                            case Constant.GAME_UI_ROAM:
                                for (int b = 0; b < 9; b++) {
                                    if (MainLogic.getInstance().uiInterFace.gameSet.QuickSet[b][0] != null) {
                                        if (Long.parseLong(MainLogic.getInstance().uiInterFace.gameSet.QuickSet[b][3])
                                                == lGoodsKey) {
                                            MainLogic.getInstance().uiInterFace.gameSet.QuickSet[b][6] = "" + shGoodsNum;
                                        }
                                    }
                                }
                                break;
                            case Constant.GAME_UI_PACKAGE:
                                if (byColumnType == 1) {
                                    //普通物品栏
                                    if (shGoodsNum > 0) {
                                        MainLogic.getInstance().uiPackage.packageGoods.setGoodsStackNum((short) iColumnIndex, shGoodsNum);
                                    } else {
                                        MainLogic.getInstance().uiPackage.packageGoods.deleteGoods((short) iColumnIndex);
                                    }
                                } else if (byColumnType == 2) {
                                    //任务物品栏
                                    if (shGoodsNum > 0) {
                                        MainLogic.getInstance().uiPackage.taskPackageGoods.setGoodsStackNum((short) iColumnIndex, shGoodsNum);
                                    } else {
                                        MainLogic.getInstance().uiPackage.taskPackageGoods.deleteGoods((short) iColumnIndex);
                                    }
                                } else if (byColumnType == 3) {
                                    //宠物物品栏
                                }
                                if (temp.length() > 1) {
                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", temp);
                                }

                                break;
                        }
                        if (stateCode == 12) {
                            GameBean.STR_CMD_QUEST_KEY = cmdData.readUTF();
                            GameBean.L_NPC_ID = cmdData.readLong();
                            GameBean.SH_CMD_QUEST = 1;
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_QUEST, Constant.SOCKET_MSG_TYPE_LOGIC);
                        }
                    } else {
                        if (Constant.ITEM_OPERATION_TYPE_RECORD == Constant.ITEM_OPERATION_TYPE_LEARNING) {
                            Constant.ITEM_OPERATION_TYPE_RECORD = -1;
                        } else if (Constant.ITEM_OPERATION_TYPE_RECORD == Constant.ITEM_OPERATION_TYPE_GAMESET) {
                            if (stateCode != 8) {
                                MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, temp);
                            }
                            Constant.ITEM_OPERATION_TYPE_RECORD = -1;
                        } else {
                            switch (MainLogic.getInstance().byGameState) {
                                case Constant.GAME_UI_ROAM:
                                    break;
                                default:
                                    if (temp.length() > 0) {
                                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", temp);
                                    }
                                    break;
                            }
                            Constant.ITEM_OPERATION_TYPE_RECORD = -1;
                        }
                    }
                    temp = null;
                    break;
                case Constant.MSG_NET_CMD_CHECK_ITEM:
                    //查看物品
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    stateCode = cmdData.readByte();
                    if (stateCode == 1 || stateCode == 2 || stateCode == 3) {
                        String[] sGoodsDetail = null;
                        Vector sVector = new Vector();
                        byte byItemsLevel = cmdData.readByte();
                        sVector.addElement("物品等级:" + byItemsLevel);
                        //职业限制
                        byte byJob = cmdData.readByte();
                        if (byJob > 0) {
                            sVector.addElement("职业要求:" + Tools.getJobName(byJob));
                        } else {
                            sVector.addElement("职业要求:无");
                        }
                        byte bySex = cmdData.readByte();
//                                                if (bySex == 0) {
//                                                    sVector.addElement("性别要求:男");
//                                                } else if (bySex == 1) {
//                                                    sVector.addElement("性别要求:女");
//                                                } else if (bySex == 3) {
//                                                    sVector.addElement("性别要求:无");
//                                                }
                        int iPirce = cmdData.readInt();
                        sVector.addElement("售价:" + Tools.moneyConvert(iPirce));
                        short shItemsType = cmdData.readShort();
                        byte byDecsNum = cmdData.readByte();
                        if (byDecsNum > 0) {
                            sGoodsDetail = new String[byDecsNum];
                            for (byte p = 0; p < byDecsNum; p++) {
                                sGoodsDetail[p] = cmdData.readUTF();
                            }
                        }
                        String desc = cmdData.readUTF();
                        //绑定类型
                        byte byBindType = cmdData.readByte();
                        byte byHole = cmdData.readByte();
                        byte byGemNum = cmdData.readByte();
                        if (byHole > 0) {
//                                                    sVector.addElement("已打孔:+" + byHole);
                        }
                        if (byGemNum > 0) {
                            //sVector.addElement("已镶嵌宝石:+" + byGemNum);
                            String sGemName;
                            String sGemDesc;
                            for (j = 0; j < byGemNum; j++) {
                                sGemName = cmdData.readUTF();
                                sVector.addElement("镶嵌宝石" + ":" + sGemName);
                                sGemDesc = cmdData.readUTF();
                                //sVector.addElement(sGemDesc);
                            }
                        }
                        //强化等级
                        byte byStrengthLevel = cmdData.readByte();
                        if (byStrengthLevel > 0) {
                            byte byStrengthType = cmdData.readByte();
                            short shStrengthValue = cmdData.readShort();
                            if (byStrengthLevel > 0) {
                                sVector.addElement("强化等级:+" + byStrengthLevel);
                                if (byStrengthType == 1) {
                                    sVector.addElement("攻击强化加成:+" + shStrengthValue);
                                } else {
                                    sVector.addElement("防御强化加成:+" + shStrengthValue);
                                }
                            }
                        }

                        byte byBind = cmdData.readByte();
                        if (byBind == 1) {
                            sVector.addElement("绑定:" + "已绑定");
                        } else {
                            if (byBindType == 0) {
                                sVector.addElement("绑定:" + "不绑定");
                            } else if (byBindType == 1) {
                                sVector.addElement("绑定:" + "使用后绑定");
                            } else if (byBindType == 2) {
                                sVector.addElement("绑定:" + "拾取后绑定");
                            } else if (byBindType == 3) {
                                sVector.addElement("绑定:" + "使用绑定道具后绑");
                            } else {
                                sVector.addElement("绑定:" + "未绑定");
                            }
                        }
                        byDurability = cmdData.readByte();
                        if (byDurability > -1) {
                            sVector.addElement("耐久度:" + byDurability);
                        }
                        if (sGoodsDetail != null) {
                            for (byte p = 0; p < sGoodsDetail.length; p++) {
                                sVector.addElement(sGoodsDetail[p]);
                            }
                        }
                        byte bySet = cmdData.readByte();
                        if (bySet == 1) {
                            sVector.addElement("<l套装效果:  ");
                            byte bySetNum = cmdData.readByte();
                            String bySetDesc;
                            byte byUsing = 0;
                            if (GameBean.BY_CMD_COLUMN_TYPE == 2) {
                                byUsing = cmdData.readByte();
                            }
                            for (j = 1; j <= bySetNum; j++) {
                                bySetDesc = cmdData.readUTF();
                                if (j + 1 <= byUsing) {
                                    sVector.addElement("(" + String.valueOf(j + 1) + "件)" + bySetDesc);
                                } else {
                                    sVector.addElement("<e(" + String.valueOf(j + 1) + "件)" + bySetDesc);
                                }
                            }
                            bySetDesc = null;
                        }
                        sGoodsDetail = new String[sVector.size()];
                        sVector.copyInto(sGoodsDetail);
                        sVector = null;
                        MainLogic.getInstance().uiInterFace.sysMessage.openCheckItem(sGoodsDetail, desc, (Goods.getGoodsOperationType(shItemsType) == Constant.ITEM_TYPE_WEAPONS || Goods.getGoodsOperationType(shItemsType) == Constant.ITEM_TYPE_EQUIP) ? true : false, byHole, byGemNum);
                        sGoodsDetail = null;
                        desc = null;

                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "物品查看失败");
                    }
                    break;
                //登录游戏  state (1byte)
                case Constant.MSG_NET_CMD_LOGIN:
                    stateCode = cmdData.readByte();
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    if (stateCode == 0) {
//                         NetManager.blHaveSendLogin = 1;
                        if (Constant.QUICK_GAME == 2) {
                            Constant.QUICK_GAME = 0;
                            MainLogic.getInstance().uiInterFace.byMaxLoadingNum = (byte) 80;
                            NetController.getInstance().send(Constant.MSG_NET_ENTER_WORLD, Constant.SOCKET_MSG_TYPE_LOGIC);
                        } else {
                            MainLogic.getInstance().uiInterFace.byMaxLoadingNum = (byte) 80;
                            NetController.getInstance().send(Constant.MSG_NET_CMD_GET_ROLES, Constant.SOCKET_MSG_TYPE_LOGIC);
                        }
                    } else {
                        if (Constant.QUICK_GAME == 2) {
                            Constant.QUICK_GAME = 0;
                        }
                        MainLogic.getInstance().exitGame();
                        switch (stateCode) {
                            case 1:
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "用户不存在");
                                break;
                            case 2:
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "密码错误");
                                break;
                            case 3:
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "此帐号再其它地点登陆您被迫下线");
                                break;
                        }
                    }
                    break;
                //获得角色列表 角色数量(1byte)	角色id(8byte)	角色等级(4byte)	角色名字(变长)
                case Constant.MSG_NET_CMD_GET_ROLES:
                    long roleId = 0;
                    int rolelevel,
                     rolesex;
                    String roleName,
                     rolejob,
                     rolePos;
                    byte roleNums = cmdData.readByte();
                    if (roleNums > 0) {
                        MainLogic.getInstance().uiLogin.sDataArray = new String[roleNums * 6];
                    }
//                                    Tools.printLog("已存在角色数量" + roleNums);
                    //角色职业(变长)	角色性别(4byte)
                    for (j = 0; j < roleNums; j++) {
                        roleId = cmdData.readLong();
                        rolelevel = cmdData.readInt();
                        roleName = cmdData.readUTF();
                        rolejob = cmdData.readUTF();
                        rolesex = cmdData.readInt();
                        rolePos = cmdData.readUTF();
                        MainLogic.getInstance().uiLogin.sDataArray[j * 6 + 0] = String.valueOf(roleId);
                        MainLogic.getInstance().uiLogin.sDataArray[j * 6 + 1] = String.valueOf(rolelevel);
                        MainLogic.getInstance().uiLogin.sDataArray[j * 6 + 2] = roleName;
                        MainLogic.getInstance().uiLogin.sDataArray[j * 6 + 3] = Tools.getRoleJob(rolejob);
                        MainLogic.getInstance().uiLogin.sDataArray[j * 6 + 4] = String.valueOf(rolesex);
                        MainLogic.getInstance().uiLogin.sDataArray[j * 6 + 5] = rolePos;
                    }
                    roleName = null;
                    rolejob = null;
                    rolePos = null;
                    MainLogic.getInstance().uiInterFace.byMaxLoadingNum = (byte) 100;
                    break;
                    //yj111
               
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    
    }
    public void processMessage1_2(int msgId, DataInputStream cmdData) 
    {

        try {
            byte stateCode;
            int index;
            int xp = 0;
            int j = 0;
            switch (msgId) {
             	
                case Constant.MSG_NET_CREATE_ROLE:
                    //创建角色
                    stateCode = cmdData.readByte();
//                    if (stateCode == 1) {
//                        GameBean.L_CMD_PLAYER_OWN_ID = cmdData.readLong();
//                        MainLogic.getInstance().gamePlayer = new Player(Constant.PLAYER_OCCUPTION_ASSASSIN, GameBean.BY_CMD_PLAYER_SEX, (byte) -1);
//                        MainLogic.getInstance().gamePlayer.lPlayerID = GameBean.L_CMD_PLAYER_OWN_ID;
//                        Rms.saveGame(Constant.RMS_PLAYER_ID, null);
//                        MainLogic.getInstance().uiInterFace.byMaxLoadingNum = (byte) 40;
//                        Rms.loadGame(Constant.RMS_NEW_PLAYER_CAN_GO_LOCK);
//                        //发送登入游戏消息指令
//                        NetController.getInstance().send(Constant.MSG_NET_ENTER_WORLD, Constant.SOCKET_MSG_TYPE_LOGIC);
//                    } else
                    if (stateCode == 2) {
                        //提示创建角色失败
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "角色创建失败", (byte) 0, Constant.GAME_UI_LOGO);
                        MainLogic.getInstance().pushState(Constant.GAME_UI_CREATE_ROLE, true);
                    } else if (stateCode == 3) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "角色名称重复");
                        MainLogic.getInstance().pushState(Constant.GAME_UI_CREATE_ROLE, true);
                    } else if (stateCode == 4) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您的名字中不能使用非法词句");
                        MainLogic.getInstance().pushState(Constant.GAME_UI_CREATE_ROLE, true);
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "角色创建失败", (byte) 0, Constant.GAME_UI_LOGO);
                        MainLogic.getInstance().pushState(Constant.GAME_UI_CREATE_ROLE, true);
                    }
                    break;
                case Constant.MSG_NET_CMD_ENTER_SCENE:
                    System.gc();
                    Npc.blHaveInitNpc = false;    //测试用
                    MainLogic.getInstance().clearLockedObj(0, true);
                    String SsceneKey = cmdData.readUTF();
                    String SsceneName = cmdData.readUTF();
                    Tools.printLog("MSG_NET_CMD_ENTER_SCENE:receive" + SsceneKey + "SsceneName:" + SsceneName);
                    MainLogic.getInstance().uiInterFace.changeScence(SsceneKey, SsceneName);
                    SsceneName = null;
                    SsceneKey = null;
                    MainLogic.getInstance().gamePlayer.bChangeSceneLock = false;
                    //地形资源id
                    int imgId = cmdData.readInt();
                    //坐标x,y
                    int playerx = cmdData.readInt();
                    int playery = cmdData.readInt();
                    GameBean.i_CANMOVE_POS_X = playerx;
                    GameBean.i_CANMOVE_POS_Y = playery;
                    byte byTowardsx = cmdData.readByte();
                    GameBean.BY_SCENE = cmdData.readByte();
                    GameBean.BY_SAFE_MAP = cmdData.readByte();
                    Tools.printLog("场景种类：" + GameBean.BY_SCENE);
                    Tools.printLog("安全区类型：" + GameBean.BY_SAFE_MAP);
                    MainLogic.gamePlayer.iPlayerX = playerx;
                    MainLogic.gamePlayer.iPlayerY = playery;
                    MainLogic.getInstance().gamePlayer.updatePosition(playerx, playery, Tools.getClientDirection(byTowardsx));
                    if (!Constant.again_connection) {
                        MainLogic.getInstance().gameNpcArray.clearNpc();
                        MainLogic.getInstance().gameOtherplayerArray.clearOtherPlayer();
                        Map.clearMap();
                        ResManager.clearRes(Constant.RES_PUBLIC_ONEROOM);
                    }
                    System.gc();
                    NetController.getInstance().setTerrainId(imgId);
                    if (MainLogic.getInstance().gamePlayer.iPetsAniId != -1) {
                        MainLogic.getInstance().gamePlayer.bLoadPetAni = true;
                    }
                    Player.resetAutoRunTagPath(MainLogic.gamePlayer.getAutoRunTagPath());
                    MainLogic.getInstance().gamePlayer.clearPath();
                    if (Player.getAutoRunTagPath() == -1) {
                        MainLogic.getInstance().gamePlayer.clearFindPath();
                    }
                    if (MainLogic.getInstance().gamePlayer.byPlayerState != Constant.PLAYER_STATE_DIE) {
                        MainLogic.getInstance().gamePlayer.byPlayerState = Constant.PLAYER_STATE_STAND;
                    }
                    if (MainLogic.getInstance().gamePlayer.byPlayerState != Constant.PLAYER_STATE_DIE) {
                        MainLogic.getInstance().gamePlayer.byPlayerState = Constant.PLAYER_STATE_STAND;
                    }
                    MainLogic.getInstance().uiInterFace.byMaxLoadingNum = (byte) 90;
                    if (!Constant.again_connection) {
                        Rms.loadGame(Constant.RMS_ONE_ROOM_IMAGE);
                        if (!Rms.loadGame(Constant.RMS_MAP_TER_DATA)) {
                            if (isLocalTer(NetController.getInstance().getTerrainId())) {
//                                System.out.println("load local ter:" + NetController.getInstance().getTerrainId());
                                MainLogic.gameMap.initMapData(new DataInputStream(Utils.GetResourceAsStream(Constant.RES_TER_PATH + NetController.getInstance().getTerrainId() + ".ter")), true);
                                if (UiInterFace.byMaxLoadingNum != 100) {
                                    UiInterFace.byMaxLoadingNum = (byte) 85;
                                }
                            } else {
                                MainLogic.netController.send(Constant.MSG_NET_GET_TERRAIN, Constant.SOCKET_MSG_TYPE_RES);
                            }
                        }
                        if (MainLogic.blLogined) {
                            MainLogic.getInstance().uiInterFace.setGameNextState(Constant.GAME_UI_ROAM);
                            MainLogic.pushState(Constant.GAME_UI_LOADING, false);
                        }
                    }
//                     GameBean.SCREEN_TYPE = 0;
//                MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPT_ON_SCREEN, Constant.SOCKET_MSG_TYPE_LOGIC);
//                Tools.printLog("关闭请求" + GameBean.SCREEN_TYPE);
//                    MainLogic.getInstance().uiInterFace.byMaxLoadingNum = (byte) 100;
                    break;
                //
                case Constant.MSG_NET_ENTER_WORLD:
                    //登录进入游戏
                    GameBean.b_WAIT_NET_MSG_BACK = false;
                    System.gc();
                    stateCode = cmdData.readByte();
                    if (Constant.DEBUG) {
                        MainCanvas.addLog("login:cod" + stateCode);
                    }
                    if (stateCode == 1) {
                        GameBean.BY_QUICK_ENTER = 1;
                        Rms.saveGame(Constant.RMS_QUICK_STATUS, null);
                        GameBean.BL_PLAYER_ENTER_CENCE = true;
                        //玩家状态
                        byte byPlayerState = cmdData.readByte();
                        Tools.printLog("玩家状态：：：" + byPlayerState);
                        //速度
                        short shSpeed = cmdData.readShort();
                        //PK状态
                        byte pkState = cmdData.readByte();
                        //角色动画
                        String roleid = cmdData.readUTF();
                        //变身ID
//                        String avatarid = cmdData.readUTF();
//                        MainLogic.getInstance().gamePlayer.changeAvatar(avatarid);
                        //朝向
                        //需要添加角色的血和蓝和角角色性别
                        String playerName = cmdData.readUTF();
                        if (Constant.DEBUG) {
                            MainCanvas.addLog("playerName:" + playerName);
                        }
                        int level = cmdData.readInt();
                        byte sex = cmdData.readByte();
                        byte occupation = cmdData.readByte();
                        int hp = cmdData.readInt();
                        Tools.printLog("当前血：：：" + hp);
                        int maxHp = cmdData.readInt();
                        Tools.printLog("最大血：：：" + maxHp);
                        int mp = cmdData.readInt();
                        Tools.printLog("当前蓝：：：" + mp);
                        int maxMp = cmdData.readInt();
                        Tools.printLog("最大血：：：" + maxMp);
                        xp = cmdData.readInt();
                        int maxXp = cmdData.readInt();
                        long playerid = cmdData.readLong();
                        String tongname = cmdData.readUTF();
                        if (Constant.DEBUG) {
                            MainCanvas.addLog("登陆时候用户的id:" + playerid);
                        }
//                        Tools.printLog("登陆时候用户的id:" + playerid);
                        Tools.printLog("登录游戏时的帮派代号：" + tongname);
                        byte tongDuty = cmdData.readByte();
                        Tools.printLog("帮派职位" + tongDuty);
                        long tongId = cmdData.readLong();
                        Tools.printLog("帮派ID" + tongId);
//                        short shPlayerSkillNum = cmdData.readShort();
                        MainLogic.getInstance().gamePlayer = null;
                        Player.clearStaticVariable();
                        MainLogic.getInstance().gamePlayer = new Player(occupation, sex, (byte) -1);
                        MainLogic.getInstance().gamePlayer.changeAvatar(roleid);
                        if (Constant.DEBUG) {
                            MainCanvas.addLog("initplayer ok");
                        }
//                        String sPlayerSkillKey;
//                        int iPlayerSkillskillID;
//                        String shPlayerSkillActID;
//                        byte byPlayerSkillType;
//                        int iPlayerCoolTime;
//                        int skillDistance;
//                        int skillMp;
//                        byte skillAttackType;
//                        Tools.printLog("数量：" + shPlayerSkillNum);
//                        try {
//                            for (j = 0; j < shPlayerSkillNum; j++) {
//                                sPlayerSkillKey = cmdData.readUTF();
//                                iPlayerSkillskillID = cmdData.readInt();
//                                shPlayerSkillActID = cmdData.readUTF();
//                                byPlayerSkillType = cmdData.readByte();
//                                iPlayerCoolTime = cmdData.readInt();
////技能施法距离(4byte)技能耗蓝(4byte)技能攻击类型(byte)
//                                skillDistance = cmdData.readInt();
//                                skillMp = cmdData.readInt();
//                                skillAttackType = cmdData.readByte();
//                                MainLogic.getInstance().gamePlayer.addPlayerSkill(shPlayerSkillNum, j, sPlayerSkillKey, byPlayerSkillType, iPlayerSkillskillID,
//                                        shPlayerSkillActID, iPlayerCoolTime, skillDistance, skillMp, skillAttackType);
//                                Tools.printLog("技能K" + sPlayerSkillKey + "byPlayerSkillType" + byPlayerSkillType);
//                            }
//                            if (Constant.DEBUG) {
//                                MainCanvas.addLog("loadskill ok");
//                            }
//                        } catch (Exception e) {
//                            if (Constant.DEBUG) {
//                                MainCanvas.addLog("loadskill failed" + e.getMessage());
//                            }
//                        }

                        MainLogic.getInstance().gamePlayer.sPlayerName = playerName;
                        if (tongname.equals("")) {
                            MainLogic.getInstance().gamePlayer.sTongName = null;
                        } else {
                            MainLogic.getInstance().gamePlayer.sTongName = "[" + tongname + "]";
                            Tools.printLog("不为空");
                        }
                        MainLogic.getInstance().gamePlayer.bTongDuty = tongDuty;
                        MainLogic.getInstance().gamePlayer.lTongId = tongId;
                        MainLogic.getInstance().gamePlayer.bPkState = pkState;

                        MainLogic.getInstance().gamePlayer.iPkPoint = cmdData.readInt();
                        //状态
                        if (Constant.DEBUG) {
                            MainCanvas.addLog("login:" + shSpeed);
                        }
                        MainLogic.getInstance().gamePlayer.updateSpeed(shSpeed);
//                                        //坐标
//                                        MainLogic.getInstance().gamePlayer.iPlayerX = playerx;
//                                        MainLogic.getInstance().gamePlayer.iPlayerY = playery;
                        //角色名称
                        MainLogic.getInstance().gamePlayer.sPlayerName = playerName;
                        //角色等级
                        MainLogic.getInstance().gamePlayer.iPlayerLevel = level;
                        //角色性别
                        MainLogic.getInstance().gamePlayer.byPlayerSex = sex;
                        //职业
                        MainLogic.getInstance().gamePlayer.iplayerOccupation = occupation;
                        //血量
                        MainLogic.getInstance().gamePlayer.iPlayerHP = hp;
                        MainLogic.getInstance().gamePlayer.iPlayerMaxHP = maxHp;
                        Tools.printLog("初始血：：：" + hp + "," + maxHp);
                        //魔法
                        MainLogic.getInstance().gamePlayer.iPlayerMP = mp;
                        MainLogic.getInstance().gamePlayer.iPlayerMaxMP = maxMp;
                        Tools.printLog("初始蓝：：：" + mp + "," + maxMp);
                        //经验
                        MainLogic.getInstance().gamePlayer.iPlayerXP = xp;
                        MainLogic.getInstance().gamePlayer.iPlayerMaxXP = maxXp;
                        //角色ID
                        MainLogic.gamePlayer.lPlayerID = playerid;


                        QuickOption.byBoxType = (byte) (cmdData.readByte() + 1);
                        Tools.printLog("QuickOption.byBoxType=" + QuickOption.byBoxType);
                        QuickOption.initBox();

                        if (byPlayerState == 3)//如果玩家死亡
                        {
                            MainLogic.getInstance().gamePlayer.byPlayerState = Constant.PLAYER_STATE_DIE;
                        } else {
                            MainLogic.getInstance().gamePlayer.changeAction(Constant.PLAYER_STATE_STAND, MainLogic.getInstance().gamePlayer.byPlayerDirection, true, false);
                        }
                        //发送版本号
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_CMD_SET_VERSION, Constant.SOCKET_MSG_TYPE_LOGIC);
                        Constant.again_connection = false;
                        //需要添加角色的血和蓝和角角色性别
                        playerName = null;
                        tongname = null;
                        Tools.printLog("登录游戏时的帮派代号：" + tongname);
//                        sPlayerSkillKey = null;
//                        shPlayerSkillActID = null;
                        playerName = null;
                        tongname = null;
//                        buffid = null;
                        roleid = null;
//                        playeravatarId = null;
                        if (Constant.DEBUG) {
                            MainCanvas.addLog("enterworld ok");
                        }
                        //loading 进度条数值
                        MainLogic.getInstance().uiInterFace.byMaxLoadingNum = (byte) 90;
                    } else if (stateCode == 2) {
                        System.out.print("获取角色失败");
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "获取角色失败", (byte) 0, Constant.GAME_UI_OPTION_LIST);
                    }
                    break;
                case Constant.MSG_NET_OTHER_PLAYER_INFO:
                    try {
                        index = -1;
                        byte type = 0;
                        byte objType = 0;
                        j = 0;
                        int playerX;
                        int playerY;
                        byte playerState;
                        byte playerAction;
                        byte playerDirection;
                        short playerSpeed;
                        short playerAvatarNum = 0;
                        String playerAniID = null;
                        int pkPoint;
                        byte tongDuty;
                        byte bShowPet;

                        short shPetHeight = 0;
                        int k = 0;
                        //npc
                        long npcid;
                        short npctype;
                        int npcx;
                        int npcy;
                        byte npcState;
                        byte npcAction;
                        byte npcDirectx;
                        short npcSpeed;
                        byte npcgender;
                        byte npcDifficulty;
                        byte npclevel;
                        short npcHeight;
                        String npcAniId;
                        byte byNpsMissionView;
                        String playername;
                        String[] playerAvatarID = null;
                        byte[] playerAvatarPlace = new byte[]{};
                        long playerID;
                        byte job;
                        byte sex;
                        String tongname;
                        String sAvatarID = "-1";
                        String sAvatarName = null;
                        String npcName;
                        String skillKey = null;
                        short iSkillID = 0;
                        String actId = null;
                        long byTargetid = -1;
                        short byTargetType = -1;
                        byte flow = cmdData.readByte();//流量设置
                        MainLogic.getInstance().uiEquipment.stateflow = (byte) (flow - 1);
//                        System.out.println("flow11   " +  MainLogic.getInstance().uiEquipment.stateflow);
                        short nums = cmdData.readShort();//数量
                        for (j = 0; j < nums; j++) {
                            skillKey = null;
//                            objType = cmdData.readByte();//同屏对象类型对象类型：1----player 2----npc
                            //同屏类型(byte)player同屏类型: 100-新进入的player 1 avatar同屏2帮派同屏  4-走路同屏
                            //Npc同屏类型：100----新进入的npc 1 头顶标记同屏 2-走路同屏
                            type = cmdData.readByte();

                            //同屏对象是其他玩家
                            if (type == 1) {//新进入的player
                                playerID = cmdData.readLong();
                                playername = cmdData.readUTF();
                                playerX = cmdData.readShort();
                                playerY = cmdData.readShort();
                                playerState = cmdData.readByte();
                                playerAction = cmdData.readByte();
                                if (playerAction == 4) {
                                    //技能字符串
                                    skillKey = cmdData.readUTF();
                                    iSkillID = cmdData.readShort();
                                    actId = cmdData.readUTF();
                                    byTargetid = cmdData.readLong();
                                    byTargetType = cmdData.readShort();
                                }
                                playerDirection = cmdData.readByte();
                                playerSpeed = cmdData.readShort();
                                job = cmdData.readByte();
                                sex = cmdData.readByte();
                                playerAniID = cmdData.readUTF();
                                //#if NOKIA_S40V3 || NORMAL_240_400 || MOT0 || K790
                                //#else
                                playerAvatarNum = cmdData.readShort();
                                playerAvatarID = new String[playerAvatarNum];
                                playerAvatarPlace = new byte[playerAvatarNum];
                                for (k = 0; k < playerAvatarNum; k++) {
                                    playerAvatarPlace[k] = cmdData.readByte();
                                    playerAvatarID[k] = cmdData.readUTF();
                                }
                                //#endif
                                pkPoint = cmdData.readInt();
                                tongname = cmdData.readUTF();
                                tongDuty = cmdData.readByte();
                                //是否在溜宠
                                bShowPet = cmdData.readByte();

                                if (bShowPet == 1) {
                                    sAvatarID = cmdData.readUTF();
                                    sAvatarName = cmdData.readUTF();
                                    shPetHeight = cmdData.readShort();
                                }
                                MainLogic.getInstance().gameOtherplayerArray.addOther(playerID, job, sex,
                                        (playerAniID),
                                        ((playerAvatarID == null) ? null : String.valueOf(playerAvatarID[0])),
                                        (String.valueOf(playerAniID)), playername,
                                        (short) 1, (short) 0, (short) 0, (short) 0, (short) 0, playerState, playerAction,
                                        Tools.getClientDirection(playerDirection), playerX, playerY,
                                        playerSpeed, pkPoint, tongname, tongDuty);
                                if (MainLogic.getInstance().gameOtherplayerArray.repeatTable.get(new Long(playerID)) != null) {
                                    index = (int) ((Integer) (MainLogic.getInstance().gameOtherplayerArray.repeatTable.get(new Long(playerID)))).intValue();
                                }
                                if (index != -1) {
                                    for (k = 0; k < playerAvatarNum; k++) {
                                        MainLogic.getInstance().gameOtherplayerArray.addAvatarAni(index, playerAvatarID[k], playerAvatarPlace[k]);
                                    }
                                }
                                if (bShowPet == 1) {
                                    MainLogic.getInstance().gameOtherplayerArray.addPetsAni(index, Integer.parseInt(sAvatarID), sAvatarName, shPetHeight);
                                }
                                playername = null;
                                playerAvatarPlace = null;
                                playerAvatarID = null;
                                tongname = null;
                                sAvatarID = null;
                                sAvatarName = null;
                            } else if (type == 2) {
                                playerID = cmdData.readLong();
                                playerX = cmdData.readShort();
                                playerY = cmdData.readShort();
                                playerState = cmdData.readByte();
                                playerAction = cmdData.readByte();
                                if (playerAction == 4) {
                                    //技能字符串
                                    skillKey = cmdData.readUTF();
                                    iSkillID = cmdData.readShort();
                                    actId = cmdData.readUTF();
                                    byTargetid = cmdData.readLong();
                                    byTargetType = cmdData.readShort();
                                    index = MainLogic.getInstance().gameOtherplayerArray.getOther(playerID);
                                }
                                playerDirection = cmdData.readByte();
                                MainLogic.getInstance().gameOtherplayerArray.refreshPlayerWalk(playerID, playerState, playerAction, Tools.getClientDirection(playerDirection), playerX, playerY);
                            } else if (type == 3) {
                                //得到npc
                                npcid = cmdData.readLong();
                                npctype = cmdData.readByte();
                                npcName = cmdData.readUTF();
                                npcx = cmdData.readShort();
                                npcy = cmdData.readShort();
                                npcState = cmdData.readByte();
                                npcAction = cmdData.readByte();
                                if (npcAction == 4) {
                                    //技能字符串
                                    //技能字符串
                                    skillKey = cmdData.readUTF();
                                    iSkillID = cmdData.readShort();
                                    actId = cmdData.readUTF();
                                    byTargetid = cmdData.readLong();
                                    byTargetType = cmdData.readShort();
                                    index = MainLogic.getInstance().gameNpcArray.getNpc(npcid);
                                }
                                npcDirectx = cmdData.readByte();
                                npcSpeed = cmdData.readShort();
                                npcgender = cmdData.readByte();//性别
                                npcDifficulty = cmdData.readByte();
                                npclevel = cmdData.readByte();
                                npcHeight = cmdData.readShort();
                                npcAniId = cmdData.readUTF();
                                //任务标记
                                byNpsMissionView = cmdData.readByte();
                                try {
                                    if (npcState == 3) {
                                        index = -1;
                                        try {
                                            if (MainLogic.getInstance().gameNpcArray.repeatTable.get(new Long(npcid)) != null) {
                                                index = (int) ((Integer) (MainLogic.getInstance().gameNpcArray.repeatTable.get(new Long(npcid)))).intValue();
                                                MainLogic.getInstance().gameNpcArray.npcDie(index);
                                                MainLogic.getInstance().gameNpcArray.deleteNpc(index);
                                            }
                                        } catch (Exception e) {
                                            if (Constant.DEBUG) {
                                                e.printStackTrace();
                                            }
                                        }
                                    } else {
                                        MainLogic.getInstance().gameNpcArray.addNPc(npcid, null, npcAniId, npctype,
                                                npcName, npclevel, (short) 0, (short) 0, (short) 0, (short) 0, npcState, npcAction,
                                                Tools.getClientDirection(npcDirectx), npcx, npcy, npcSpeed,
                                                byNpsMissionView, npcDifficulty, npcHeight, npcgender);
                                    }
                                    npcName = null;
                                } catch (Exception e) {
                                    e.printStackTrace();
                                    MainLogic.uiInterFace.sysMessage.showMessage("提示", "addNPc异常", (byte) 1, (byte) -1);
                                }
                                npcName = null;
                            } else if (type == 4) {
                                npcid = cmdData.readLong();
                                npctype = cmdData.readByte();
                                if (npctype == 2) {
                                    //任务标记
                                    byNpsMissionView = cmdData.readByte();
                                    MainLogic.getInstance().gameNpcArray.refreshNpcMission(npcid, byNpsMissionView);
                                } else if (npctype == 1) {
                                    npcx = cmdData.readShort();
                                    npcy = cmdData.readShort();
                                    npcState = cmdData.readByte();
                                    npcAction = cmdData.readByte();
                                    if (npcAction == 4) {
                                        //技能字符串
                                        skillKey = cmdData.readUTF();
                                        iSkillID = cmdData.readShort();
                                        actId = cmdData.readUTF();
                                        byTargetid = cmdData.readLong();
                                        byTargetType = cmdData.readShort();
                                        index = MainLogic.getInstance().gameNpcArray.getNpc(npcid);
                                    }
                                    npcDirectx = cmdData.readByte();
                                    MainLogic.getInstance().gameNpcArray.refreshScreenNpc(npcid, npcState, npcAction,
                                            Tools.getClientDirection(npcDirectx), npcx, npcy);
                                }
                            }
                            //1101增加光效
                            if (skillKey != null) {
                                if (index != -1) {
                                    int indexa = actId.indexOf(",");
                                    if (indexa != -1) {
                                        //#if NOKIA_S40V3 || NORMAL_240_400 || MOT0 || K790
//#                                         actId = actId.substring(indexa + 1);//substring(index + 1)
                                        //#else
                                        actId = actId.substring(0, indexa);
                                        //#endif
                                    }
                                    //npc战斗
                                    if (type == 3 || type == 4) {
                                        MainLogic.getInstance().gameNpcArray.changeAction(index, Byte.parseByte(actId), (byte) -1);
                                        //目标
                                        if (index != -1 && iSkillID != 0) {
                                            if (MainLogic.getInstance().uiEquipment.isopenset[10]) {
                                                if (byTargetType == 2) {
                                                    int index1 = MainLogic.getInstance().gameOtherplayerArray.getOther(byTargetid);
                                                    if (index1 != -1) {
                                                        MainLogic.getInstance().aSkillManager.addSkillAni(SkillManager.getSkillIndex(iSkillID),
                                                                Constant.SKILL_TYPE_NPC, (byte) -1, skillKey, (int) iSkillID, MainLogic.getInstance().gameNpcArray.iNpcXs[index], MainLogic.getInstance().gameNpcArray.iNpcYs[index], MainLogic.getInstance().gameOtherplayerArray.iOtherXs[index1],
                                                                MainLogic.getInstance().gameOtherplayerArray.iOtherYs[index1], MainLogic.getInstance().gameNpcArray.byNpcDirection[index]);
                                                    }
                                                } else//目标
                                                {
                                                    int index1 = MainLogic.getInstance().gameNpcArray.getNpc(byTargetid);
                                                    if (index1 != -1) {
                                                        MainLogic.getInstance().aSkillManager.addSkillAni(SkillManager.getSkillIndex(iSkillID), Constant.SKILL_TYPE_NPC, (byte) -1, skillKey, iSkillID, MainLogic.getInstance().gameNpcArray.iNpcXs[index], MainLogic.getInstance().gameNpcArray.iNpcYs[index], MainLogic.getInstance().gameNpcArray.iNpcXs[index1], MainLogic.getInstance().gameNpcArray.iNpcYs[index1], MainLogic.getInstance().gameNpcArray.byNpcDirection[index]);
                                                    }
                                                }
                                            }
                                        }
                                    } else if (type == 1 || type == 2) {
                                        //目标
                                        if (index != -1 && iSkillID != 0) {
                                            if (MainLogic.getInstance().uiEquipment.isopenset[10]) {
                                                int jobSkillIndex = -1;
                                                jobSkillIndex = SkillManager.getSkillIndex(Integer.parseInt(skillKey));
                                                if (byTargetType == 2) {
                                                    int index1 = MainLogic.getInstance().gameOtherplayerArray.getOther(byTargetid);
                                                    if (index1 != -1) {

                                                        MainLogic.getInstance().aSkillManager.addSkillAni((jobSkillIndex != -1 ? jobSkillIndex : SkillManager.getSkillIndex(iSkillID)),
                                                                (jobSkillIndex != -1 ? Constant.SKILL_TYPE_OTHERPLAYER_HEART : Constant.SKILL_TYPE_OTHERPLAYER), (byte) -1, skillKey, (int) iSkillID, MainLogic.getInstance().gameOtherplayerArray.iOtherXs[index], MainLogic.getInstance().gameOtherplayerArray.iOtherYs[index], MainLogic.getInstance().gameOtherplayerArray.iOtherXs[index1],
                                                                MainLogic.getInstance().gameOtherplayerArray.iOtherYs[index1], MainLogic.getInstance().gameOtherplayerArray.byOtherDirection[index]);
                                                    }
                                                } else//目标
                                                {
                                                    int index1 = MainLogic.getInstance().gameNpcArray.getNpc(byTargetid);
                                                    if (index1 != -1)//(int index, int type, byte sex, String skillkey, int skillActId,
                                                    {
                                                        MainLogic.getInstance().aSkillManager.addSkillAni((jobSkillIndex != -1 ? jobSkillIndex : SkillManager.getSkillIndex(iSkillID)),
                                                                (jobSkillIndex != -1 ? Constant.SKILL_TYPE_OTHERPLAYER_HEART : Constant.SKILL_TYPE_OTHERPLAYER), (byte) -1, skillKey, iSkillID, MainLogic.getInstance().gameOtherplayerArray.iOtherXs[index], MainLogic.getInstance().gameOtherplayerArray.iOtherYs[index], MainLogic.getInstance().gameNpcArray.iNpcXs[index1], MainLogic.getInstance().gameNpcArray.iNpcYs[index1], MainLogic.getInstance().gameOtherplayerArray.byOtherDirection[index]);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }

                            }
                        }
                        playername = null;
                        playerAvatarID = null;
                        playerAvatarPlace = null;
                        tongname = null;
                        sAvatarID = null;
                        sAvatarName = null;
                        npcName = null;
                        tongname = null;
                        npcAniId = null;
                        sAvatarName = null;
                    } catch (Exception e) {
                        if (Constant.DEBUG) {
                            e.printStackTrace();
                        }
                    }
                    /*
                    for (j = 0; j < nums; j++) {
                    //                            objType = cmdData.readByte();//同屏对象类型对象类型：1----player 2----npc
                    //同屏类型(byte)player同屏类型: 100-新进入的player 1 avatar同屏2帮派同屏  4-走路同屏
                    //Npc同屏类型：100----新进入的npc 1 头顶标记同屏 2-走路同屏
                    type = cmdData.readByte();

                    //同屏对象是其他玩家
                    if (objType == 1) {
                    if (type == 100) {
                    playerID = cmdData.readLong();
                    playername = cmdData.readUTF();
                    playerX = cmdData.readInt();
                    playerY = cmdData.readInt();
                    playerState = cmdData.readByte();
                    playerAction = cmdData.readByte();
                    playerDirection = cmdData.readByte();
                    playerSpeed = cmdData.readShort();
                    playerAvatarNum = cmdData.readShort();
                    playerAvatarID = new String[playerAvatarNum];
                    playerAvatarPlace = new byte[playerAvatarNum];
                    for (k = 0; k < playerAvatarNum; k++) {
                    playerAvatarPlace[k] = cmdData.readByte();
                    playerAvatarID[k] = cmdData.readUTF();
                    }
                    playerAniID = cmdData.readInt();

                    pkPoint = cmdData.readInt();
                    tongname = cmdData.readUTF();
                    tongDuty = cmdData.readByte();
                    //是否在溜宠
                    bShowPet = cmdData.readByte();

                    if (bShowPet == 1) {
                    sAvatarID = cmdData.readUTF();
                    sAvatarName = cmdData.readUTF();
                    shPetHeight = cmdData.readShort();
                    }
                    MainLogic.getInstance().gameOtherplayerArray.addOther(playerID, (byte) -1,
                    (playerAniID),
                    ((playerAvatarID == null) ? null : String.valueOf(playerAvatarID[0])),
                    (String.valueOf(playerAniID)), playername,
                    (short) 1, (short) 0, (short) 0, (short) 0, (short) 0, playerState, playerAction,
                    Tools.getClientDirection(playerDirection), playerX, playerY,
                    playerSpeed, pkPoint, tongname, tongDuty);
                    if (MainLogic.getInstance().gameOtherplayerArray.repeatTable.get(new Long(playerID)) != null) {
                    index = (int) ((Integer) (MainLogic.getInstance().gameOtherplayerArray.repeatTable.get(new Long(playerID)))).intValue();
                    }
                    if (index != -1) {
                    for (k = 0; k < playerAvatarNum; k++) {
                    MainLogic.getInstance().gameOtherplayerArray.addAvatarAni(index, playerAvatarID[k], playerAvatarPlace[k]);
                    }
                    }
                    if (bShowPet == 1) {
                    MainLogic.getInstance().gameOtherplayerArray.addPetsAni(index, Integer.parseInt(sAvatarID), sAvatarName, shPetHeight);
                    }

                    playername = null;
                    playerAvatarPlace = null;
                    playerAvatarID = null;
                    tongname = null;
                    sAvatarID = null;
                    sAvatarName = null;

                    } else {

                    if (type == 1 || type == 3 || type == 5 || type == 7) {
                    playerID = cmdData.readLong();
                    playerAvatarNum = cmdData.readShort();
                    playerAvatarID = new String[playerAvatarNum];
                    playerAvatarPlace = new byte[playerAvatarNum];
                    for (k = 0; k < playerAvatarNum; k++) {
                    playerAvatarPlace[k] = cmdData.readByte();
                    playerAvatarID[k] = cmdData.readUTF();
                    }
                    playerAniID = cmdData.readInt();
                    //是否在溜宠
                    bShowPet = cmdData.readByte();

                    if (bShowPet == 1) {
                    sAvatarID = cmdData.readUTF();
                    sAvatarName = cmdData.readUTF();
                    shPetHeight = cmdData.readShort();
                    }
                    if (MainLogic.getInstance().gameOtherplayerArray.repeatTable.get(new Long(playerID)) != null) {
                    index = (int) ((Integer) (MainLogic.getInstance().gameOtherplayerArray.repeatTable.get(new Long(playerID)))).intValue();
                    }
                    if (index != -1) {
                    for (k = 0; k < playerAvatarNum; k++) {
                    MainLogic.getInstance().gameOtherplayerArray.addAvatarAni(index, playerAvatarID[k], playerAvatarPlace[k]);
                    }
                    }
                    if (bShowPet == 1) {
                    MainLogic.getInstance().gameOtherplayerArray.addPetsAni(index, Integer.parseInt(sAvatarID), sAvatarName, shPetHeight);

                    }
                    sAvatarName = null;
                    sAvatarID = null;
                    }
                    if (type == 2 || type == 3 || type == 6 || type == 7) {

                    playerID = cmdData.readLong();
                    pkPoint = cmdData.readInt();
                    tongname = cmdData.readUTF();
                    tongDuty = cmdData.readByte();
                    MainLogic.getInstance().gameOtherplayerArray.refreshOtherTongAndPk(index, pkPoint, tongname, tongDuty);
                    tongname = null;
                    }
                    if (type == 4 || type == 5 || type == 6 || type == 7) {
                    playerID = cmdData.readLong();
                    playerX = cmdData.readInt();
                    playerY = cmdData.readInt();
                    playerState = cmdData.readByte();
                    playerAction = cmdData.readByte();
                    playerDirection = cmdData.readByte();
                    MainLogic.getInstance().gameOtherplayerArray.refreshPlayerWalk(playerID, playerState, playerAction, Tools.getClientDirection(playerDirection), playerX, playerY);
                    }
                    }
                    } else if (objType == 2) {
                    if (type == 100) {
                    //得到npc
                    npcid = cmdData.readLong();
                    npctype = cmdData.readShort();
                    npcName = cmdData.readUTF();
                    npcx = cmdData.readInt();
                    npcy = cmdData.readInt();
                    npcState = cmdData.readByte();
                    npcAction = cmdData.readByte();
                    npcDirectx = cmdData.readByte();
                    npcSpeed = cmdData.readShort();
                    npcgender = cmdData.readByte();//性别
                    npcDifficulty = cmdData.readByte();
                    npclevel = cmdData.readByte();
                    npcHeight = cmdData.readShort();
                    npcAniId = cmdData.readInt();
                    //任务标记
                    byNpsMissionView = cmdData.readByte();
                    try {
                    if (npcState == 3) {
                    index = -1;
                    try {
                    if (MainLogic.getInstance().gameNpcArray.repeatTable.get(new Long(npcid)) != null) {
                    index = (int) ((Integer) (MainLogic.getInstance().gameNpcArray.repeatTable.get(new Long(npcid)))).intValue();
                    MainLogic.getInstance().gameNpcArray.npcDie(index);
                    MainLogic.getInstance().gameNpcArray.deleteNpc(index);
                    }
                    } catch (Exception e) {
                    if (Constant.DEBUG) {
                    e.printStackTrace();
                    }
                    }
                    } else {
                    MainLogic.getInstance().gameNpcArray.addNPc(npcid, null, String.valueOf(npcAniId), npctype,
                    npcName, npclevel, (short) 0, (short) 0, (short) 0, (short) 0, npcState, npcAction,
                    Tools.getClientDirection(npcDirectx), npcx, npcy, npcSpeed,
                    byNpsMissionView, npcDifficulty, npcHeight, npcgender);
                    }
                    npcName = null;
                    } catch (Exception e) {
                    e.printStackTrace();
                    MainLogic.uiInterFace.sysMessage.showMessage("提示", "addNPc异常", (byte) 1, (byte) -1);
                    }
                    npcName = null;
                    } else {
                    switch (type) {
                    case 1:
                    npcid = cmdData.readLong();
                    byNpsMissionView = cmdData.readByte();
                    MainLogic.getInstance().gameNpcArray.refreshNpcMission(npcid, byNpsMissionView);
                    break;
                    case 2:
                    npcid = cmdData.readLong();
                    npcx = cmdData.readInt();
                    npcy = cmdData.readInt();
                    npcState = cmdData.readByte();
                    npcAction = cmdData.readByte();
                    npcDirectx = cmdData.readByte();
                    MainLogic.getInstance().gameNpcArray.refreshScreenNpc(npcid, npcState, npcAction,
                    Tools.getClientDirection(npcDirectx), npcx, npcy);
                    break;
                    }
                    }
                    }
                    }
                    playername = null;
                    playerAvatarID = null;
                    playerAvatarPlace = null;
                    tongname = null;
                    sAvatarID = null;
                    sAvatarName = null;
                    npcName = null;
                    tongname = null;
                    sAvatarName = null;
                    } catch (Exception e) {
                    if (Constant.DEBUG) {
                    e.printStackTrace();
                    }
                    }
                     * */
                    break;
                case Constant.MSG_NET_PLAYER_ON_SCREEN_BATTLE:
                    int byattackerPosX = 0;
                    int byattackerPosY = 0;
                    byte attackDrict = 0;
                    byte byattackDrict = 0;
                    //发起方类型
                    byte byInitiatorAttacker = cmdData.readByte();
                    long lAttackerID = cmdData.readLong();
                    //目标方类型
                    byte byTargetType = cmdData.readByte();
                    long lbyAttacherID = cmdData.readLong();
                    //是否命中
                    byte byHit = cmdData.readByte();
                    //伤害数字,发起方对目标方造成的伤害为负数
//                                    int iDamageValue = cmdData.readInt();
                    //目标方对发起方造成的伤害数字伤害为负数
//                                    int iByDamageValue = cmdData.readInt();
                    //目标是否死亡
                    byte die = cmdData.readByte();
                    //发起方是否死亡
                    byte attackerDie = cmdData.readByte();
                    //技能字符串
                    String skillKey = cmdData.readUTF();
                    int iSkillID = cmdData.readInt();
                    String actId = cmdData.readUTF();
                    byte attackerstate = cmdData.readByte();
                    byte byattackerstate = cmdData.readByte();
                    byte attackeraction = cmdData.readByte();
                    byte byattackeraction = cmdData.readByte();
                    attackDrict = Tools.getClientDirection(cmdData.readByte());
                    byattackDrict = Tools.getClientDirection(cmdData.readByte());
                    int attackerPosX = cmdData.readInt();
                    int attackerPosY = cmdData.readInt();
                    byattackerPosX = cmdData.readInt();
                    byattackerPosY = cmdData.readInt(); {
                    index = MainLogic.getInstance().gameOtherplayerArray.getOther(lAttackerID);
                    if (index != -1) {
                        MainLogic.getInstance().gameOtherplayerArray.addOther(lAttackerID, (byte) -1, (byte) -1,
                                String.valueOf(MainLogic.getInstance().gameOtherplayerArray.strOtherResIds[index]),
                                null,
                                null, MainLogic.getInstance().gameOtherplayerArray.strOtherNames[index],
                                (short) 1, (short) 0, (short) 0, (short) 0, (short) 0, attackerstate, attackeraction,
                                attackDrict, attackerPosX, attackerPosY,
                                (short) -1, -1, MainLogic.getInstance().gameOtherplayerArray.strOtherTongNames[index], (byte) -1);
                    }
                    index = -1;
                    index = MainLogic.getInstance().gameOtherplayerArray.getOther(lbyAttacherID);
                    if (index != -1) {
                        //改变攻击方状态
                        MainLogic.getInstance().gameOtherplayerArray.addOther(lbyAttacherID, (byte) -1, (byte) -1,
                                String.valueOf(MainLogic.getInstance().gameOtherplayerArray.strOtherResIds[index]),
                                null,
                                null, MainLogic.getInstance().gameOtherplayerArray.strOtherNames[index],
                                (short) 1, (short) 0, (short) 0, (short) 0, (short) 0, byattackerstate, byattackeraction,
                                byattackDrict, byattackerPosX, byattackerPosY,
                                (short) -1, -1, MainLogic.getInstance().gameOtherplayerArray.strOtherTongNames[index], (byte) -1);

                    }
                    int jobSkillIndex = -1;
                    if (skillKey != null) {
                        jobSkillIndex = SkillManager.getSkillIndex(Integer.parseInt(skillKey));
                    }
                    //添加技能
                    if (MainLogic.getInstance().uiEquipment.isopenset[10] && (iSkillID != 0)) {
                        MainLogic.getInstance().aSkillManager.addSkillAni((jobSkillIndex != -1 ? jobSkillIndex : SkillManager.getSkillIndex(iSkillID)),
                                (jobSkillIndex != -1 ? Constant.SKILL_TYPE_OTHERPLAYER_HEART : Constant.SKILL_TYPE_OTHERPLAYER), (byte) -1, skillKey, iSkillID, attackerPosX, attackerPosY, byattackerPosX,
                                byattackerPosY, attackDrict);
                    }
                    actId = null;
                    skillKey = null;
                }
                break;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    
    }
    
    
    
    /////////////////////Yj2
    public boolean isLocalTer(int terid) {
        if (terid == 81 || terid == 32 || terid == 23) {
            return true;
        }
        return false;
    }




	public void processMessage2(int msgId, DataInputStream cmdData) {
		try {
			processMessage2_1(msgId, cmdData);
			processMessage2_2(msgId, cmdData);
			processMessage2_3(msgId, cmdData);
		} catch (Exception e) {
			if (Constant.DEBUG) {
				e.printStackTrace();
			}
		}
	}

	private void processMessage2_3(int msgId, DataInputStream cmdData)
			throws IOException {
		byte stateCode, type;
		int j = 0;
		long playerID = 0;
		switch (msgId) {
		case Constant.MSG_NET_CMD_SHOUT:
			// 聊天
			// 发起人ID(8byte)发起人alias(变长)喊话类型(byte)喊话内容(变长)
			playerID = cmdData.readLong();
			String otherPlayer = cmdData.readUTF();
			byte shoutType = cmdData.readByte();
			String shoutContent = cmdData.readUTF();
			int isRead = -1;
			switch (shoutType) {
			case 0:// 综合
				isRead = MainLogic.getInstance().uiEquipment.chatSet[0];
				break;
			case 1:// 世界
				isRead = MainLogic.getInstance().uiEquipment.chatSet[1];
				break;
			case 2:// 当前
				isRead = MainLogic.getInstance().uiEquipment.chatSet[2];
				break;
			case 3:// 队伍
				isRead = MainLogic.getInstance().uiEquipment.chatSet[4];
				break;
			case 4:// 帮派
				isRead = MainLogic.getInstance().uiEquipment.chatSet[5];
				break;
			case 5:// 系统
				isRead = MainLogic.getInstance().uiEquipment.chatSet[6];
				break;
			case 6:// 私聊
				isRead = MainLogic.getInstance().uiEquipment.chatSet[3];
				break;
			}
			// System.out.println("1111111111111111111111111111111111");
			if (isRead == 0) {
				// MainLogic.getInstance().uiEquipment.init();
				if (!shoutContent.equals("")) {
					MainLogic.getInstance().uiEquipment.getChatInformation(
							playerID, otherPlayer, shoutType, shoutContent);
				}
				// System.out.println("22222222222222222222222222");
			}
			otherPlayer = null;
			shoutContent = null;
			break;
		case Constant.MSG_NET_CMD_CHECK_DESC:
			stateCode = cmdData.readByte();
			if (stateCode == 1) {
				String sGoodsDesc = cmdData.readUTF();
				switch (MainLogic.getInstance().byGameState) {
				case Constant.GAME_UI_PACKAGE:
					MainLogic.getInstance().uiPackage
							.setGoodsDescFromNet(sGoodsDesc);
					MainLogic.getInstance().uiPackage.bWaitMSGBack = false;
					break;
				case Constant.GAME_UI_STORE_BUY:
					MainLogic.getInstance().uiInterFace.store
							.setGoodsDescFromNet(sGoodsDesc);
					MainLogic.getInstance().uiInterFace.store.bWaitMSGBack = false;
					break;
				case Constant.GAME_UI_WAREHOUSE:
					if (MainLogic.getInstance().uiPackage.bShowBAG) {
						MainLogic.getInstance().uiPackage
								.setGoodsDescFromNet(sGoodsDesc);
						MainLogic.getInstance().uiPackage.bWaitMSGBack = false;
					} else {
						MainLogic.getInstance().uiInterFace.store
								.setGoodsDescFromNet(sGoodsDesc);
						MainLogic.getInstance().uiInterFace.store.bWaitMSGBack = false;
					}
					break;
				case Constant.GAME_UI_STORE_SOLD:
				case Constant.GAME_UI_PET_EQUIP:
				case Constant.GAME_UI_GAMESET_QUICKEYS:
				case Constant.GAME_UI_CHAT:
				case Constant.GAME_UI_PET_COMPOSE:
				case Constant.GAME_UI_ITEMS_COMPOSE:
				case Constant.GAME_UI_ITEMS_DECOMPOSE:
				case Constant.GAME_UI_ITEMS_STRENGTHEN:
				case Constant.GAME_UI_EQUIP_OPERATION:
				case Constant.GAME_UI_SEND_EMAIL:
				case Constant.GAME_UI_TRADE:
					if (MainLogic.getInstance().uiPackage.bShowBAG) {
						MainLogic.getInstance().uiPackage
								.setGoodsDescFromNet(sGoodsDesc);
						MainLogic.getInstance().uiPackage.bWaitMSGBack = false;
					}
					break;
				}
				sGoodsDesc = null;
			} else {
				// Tools.printLog("获得物品描述出错");
				// MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示",
				// "获得物品描述出错");
			}
			break;
		case Constant.MSG_NET_DIFF_EQUIP:
			// 对比装备
			GameBean.b_WAIT_NET_MSG_BACK = false;
			stateCode = cmdData.readByte();
			if (stateCode == 1) {
				byte byteAttributeNum = cmdData.readByte();
				int iAttributeArray[] = null;
				if (byteAttributeNum > 0) {
					iAttributeArray = new int[byteAttributeNum * 3];
					for (short m = 0; m < byteAttributeNum; m++) {
						iAttributeArray[m * 3] = cmdData.readByte();
						// 背包
						iAttributeArray[m * 3 + 1] = cmdData.readInt();
						// 装备栏
						iAttributeArray[m * 3 + 2] = cmdData.readInt();
					}
				}
				short[] shStrength = new short[] { 0, 0, 0, 0, 0, 0 };
				/** 装备强化和镶嵌宝石的情况 */
				shStrength[0] = cmdData.readByte();
				if (shStrength[0] > 0) {
					shStrength[1] = cmdData.readByte();
					shStrength[2] = cmdData.readShort();
				}
				// 装备在人身上

				shStrength[3] = cmdData.readByte();
				if (shStrength[3] > 0) {
					shStrength[4] = cmdData.readByte();
					shStrength[5] = cmdData.readShort();
				}
				// 宝石数量
				String[] sGem = new String[6];
				byte byPHoleNum = cmdData.readByte();
				byte byPGemNum = cmdData.readByte();
				String sGemName;
				for (byte i = 0; i < byPGemNum; i++) {
					sGem[i] = cmdData.readUTF();
					cmdData.readUTF();
				}
				for (byte i = 1; i <= 3; i++) {
					if (i > byPHoleNum) {
						sGem[i - 1] = "未打孔";
					} else if (i > byPGemNum && i <= byPHoleNum) {
						sGem[i - 1] = "未镶嵌";
					}
				}
				byte byEHoleNum = cmdData.readByte();
				byte byEGemNum = cmdData.readByte();
				for (byte i = 0; i < byEHoleNum; i++) {
					sGem[3 + i] = cmdData.readUTF();
					cmdData.readUTF();
				}
				for (byte i = 1; i <= 3; i++) {
					if (i > byEHoleNum) {
						sGem[3 + i - 1] = "未打孔";
					} else if (i > byEGemNum && i <= byEHoleNum) {
						sGem[3 + i - 1] = "未镶嵌";
					}
				}
				/******/
				MainLogic.getInstance().uiInterFace.sysMessage.openDiffEquip(
						iAttributeArray, shStrength, sGem);
				iAttributeArray = null;
				shStrength = null;
				sGem = null;
			} else if (stateCode == 2) {
				MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
						"提示", "装备栏中没有此类装备");
			} else {
				MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
						"提示", "装备对比失败");
			}
			break;
		// 状态 (byte) 坐标点个数(4byte) X坐标(4byte) Y坐标(4byte)
		case Constant.MSG_NET_CMD_FIND_PATH:
			stateCode = cmdData.readByte();
			if (stateCode == 1) {
				int pathnums = cmdData.readInt();
				byte pathorder = cmdData.readByte();
				MainLogic.getInstance().gamePlayer.clearFindPath();
				int pathx, pathy = 0;
				if (pathorder == 1) {
					for (j = 0; j < pathnums; j++) {
						pathx = cmdData.readInt();
						pathy = cmdData.readInt();
						Player.addAutoRunTagPath(pathnums, j, pathx, pathy);
					}
				} else if (pathorder == 2) {
					for (j = pathnums - 1; j >= 0; j--) {
						pathx = cmdData.readInt();
						pathy = cmdData.readInt();
						Player.addAutoRunTagPath(pathnums, j, pathx, pathy);
					}
				}
				if (pathnums > 0) {
					MainLogic.getInstance().gamePlayer.startAutoMovePath();
				}
			}
			break;
		case Constant.MSG_NET_CMD_TIPS:
			byte byTipsType = cmdData.readByte();
			String sTipsContent = cmdData.readUTF();
			switch (byTipsType) {
			case 4:
				MainLogic.getInstance().uiPackage.clearPackage();
				MainLogic.getInstance().uiPackage.bShowBAG = false;
				MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
				break;

			}
			if (!sTipsContent.equals("")) {
				MainLogic.getInstance().uiEquipment.getChatInformation(100, "",
						(byte) 5, sTipsContent);
			}
			sTipsContent = null;
			break;
		case Constant.MSG_NET_CMD_ADD_MITZVAH:// 玩家增加修为
			int mitzvah = cmdData.readInt();
			MainLogic.getInstance().uiEquipment.getChatInformation(100, "",
					(byte) 5, "增加修为" + mitzvah + "点");
			break;
		case Constant.MSG_NET_CMD_TEAM_JOIN:
			// 无下行，系统通知
			break;
		case Constant.MSG_NET_CMD_TEAM_ANSWER:
			long lSponsorID = cmdData.readLong();
			String sMess = cmdData.readUTF();
			if (MainLogic.getInstance().gamePlayer.byPlayerState != Constant.PLAYER_STATE_DIE) {
				if (GameBean.BL_PLAYER_HANGUP)// 挂机直接回复同意
				{
					GameBean.L_PLAYER_ID = lSponsorID;
					GameBean.BY_APPLY_RESULT = 1;
					MainLogic.getInstance().send(
							Constant.MSG_NET_CMD_TEAM_ANSWER,
							Constant.SOCKET_MSG_TYPE_LOGIC);
				} else {
					if (MainLogic.getInstance().uiEquipment.isopenset[2]) {
						MainLogic.getInstance().uiInterFace.team
								.openTeamAnswer(lSponsorID, sMess);
					} else {
						GameBean.L_PLAYER_ID = lSponsorID;
						GameBean.BY_APPLY_RESULT = 3;
						MainLogic.getInstance().send(
								Constant.MSG_NET_CMD_TEAM_ANSWER,
								Constant.SOCKET_MSG_TYPE_LOGIC);
					}
				}
			}
			sMess = null;
			break;
		case Constant.MSG_NET_CMD_TEAM_INFO:
			long lMemberID = cmdData.readLong();
			byte byLeader = cmdData.readByte();
			short shLevel = cmdData.readShort();
			byte bySex = cmdData.readByte();
			byte byJob = cmdData.readByte();
			byte state = cmdData.readByte();
			int iHP = cmdData.readInt();
			int iMaxHP = cmdData.readInt();
			int iMP = cmdData.readInt();
			int iMaxMP = cmdData.readInt();
			String sNick = cmdData.readUTF();
			MainLogic.getInstance().uiInterFace.team.addMember(lMemberID,
					byLeader, shLevel, bySex, byJob, sNick, (short) iHP,
					(short) iMaxHP, (short) iMP, (short) iMaxMP);
			if (SkillBuffManager.buffTable != null
					&& !SkillBuffManager.buffTable.isEmpty()) {
				SkillBuffManager.buffTable.remove(new Long(lMemberID));
			}
			String buffkey = null;
			byte buffType = -1;
			int buffContinueTime = -1;
			byte buffIcon = -1;
			int passTime = -1;
			byte buffNums = cmdData.readByte();
			Tools.printLog("同屏buffer数量：：" + buffNums);
			for (int k = buffNums - 1; k >= 0; k--) {
				buffkey = cmdData.readUTF();
				buffType = cmdData.readByte();
				buffContinueTime = cmdData.readInt();
				buffIcon = cmdData.readByte();
				passTime = cmdData.readInt();
				SkillBuffManager.addToBuffTable(k, lMemberID, buffkey,
						buffType, -1, buffContinueTime, passTime, buffIcon);
			}
			sNick = null;
			buffkey = null;
			break;
		// Type (byte) 场景key (变长) X坐标 (2byte) Y坐标 (2byte)槽key (8byte)栏类型 (byte)
		case Constant.MSG_NET_CMD_CMD_GUIDE:
			String note = new String();
			type = cmdData.readByte();
			note += type;
			switch (type) {
			case 1:
				note += "|" + cmdData.readUTF() + "|" + cmdData.readShort()
						+ "|" + cmdData.readShort() + "|/学新技能";
				break;
			case 2:
				note += "|/可点经脉";
				break;
			case 3:
				note += "|/更换装备";
				break;
			case 4:
				note += "|" + cmdData.readLong() + "|" + cmdData.readByte()
						+ "|/" + cmdData.readUTF() + "礼包";
				break;
			}
			MainLogic.uiInterFace.quickOption.addQuickOption(note, true);
			break;
		case Constant.MSG_NET_BATTLE:
			// 0—其他类型 1—NPC类型 2—玩家类型
			// 发起方类型
			int byattackerPosX = 0;
			int byattackerPosY = 0;
			byte attackDrict = 0;
			byte byattackDrict = 0;
			byte byInitiatorAttacker = cmdData.readByte();
			long lAttackerID = cmdData.readLong();
			// 目标方类型
			byte byTargetType = cmdData.readByte();
			long lbyAttacherID = cmdData.readLong();
			if (lAttackerID == MainLogic.getInstance().gamePlayer.lPlayerID
					&& lbyAttacherID != MainLogic.getInstance().gamePlayer.lPlayerID) {
				GameBean.L_PLAYER_ID = lbyAttacherID;
			}
			// Tools.printLog("接收时目标方ID：" + lbyAttacherID + "，发起方ID：" +
			// lAttackerID);
			// 是否命中
			byte byHit = cmdData.readByte();
			// 伤害数字,发起方对目标方造成的伤害为负数
			// int iDamageValue = cmdData.readInt();
			// 目标方对发起方造成的伤害数字伤害为负数
			// int iByDamageValue = cmdData.readInt();
			// 目标是否死亡
			byte die = cmdData.readByte();
			// 发起方是否死亡
			byte attackerDie = cmdData.readByte();

			// 技能字符串
			String skillKey = cmdData.readUTF();
			byte bySkillType = cmdData.readByte();
			int iSkillID = cmdData.readInt();
			// 发起方的属性
			int iAttackerMaxHP = cmdData.readInt();
			int iAttackerHP = cmdData.readInt();
			if (iAttackerHP < 0) {
				iAttackerHP = 0;
			}
			// Tools.printLog("发起访血量：" + iAttackerMaxHP + "," + iAttackerHP);
			int iAttackerMaxMP = cmdData.readInt();
			int iAttackerMP = cmdData.readInt();
			// Tools.printLog("发起方蓝量：" + iAttackerMaxMP + "," + iAttackerMP);
			// 被攻击方的属性
			int ibyAttackerMaxHP = 0;
			int ibyAttackerHP = 0;
			int ibtyAttackerMaxMP = 0;
			int ibyAttackerMP = 0;
			if (byTargetType == 1 && die == 1) {
			} else {
				// 被攻击方的属性
				ibyAttackerMaxHP = cmdData.readInt();
				ibyAttackerHP = cmdData.readInt();
				if (ibyAttackerHP < 0) {
					ibyAttackerHP = 0;
				}
				// Tools.printLog("被攻击方血量：" + ibyAttackerMaxHP + "," +
				// ibyAttackerHP);
				ibtyAttackerMaxMP = cmdData.readInt();
				ibyAttackerMP = cmdData.readInt();
				// Tools.printLog("被攻击方蓝量：" + ibtyAttackerMaxMP + "," +
				// ibyAttackerMP);
			}
//			byte type = 0;
			String actId = cmdData.readUTF();
			// 发起方状态(byte)目标方状态(byte)发起方动作(byte)目标方动作(byte)发起方方向X(byte)发起方方向Y(byte)目标方方向X(byte)目标方方向Y(byte)发起方位置X
			// (4byte)发起方位置Y(4byte)目标方位置X(4byte)目标方位置Y(4byte)是否幸运一击(byte)冰伤害(4byte)
			// 火伤害(4byte)毒伤害(4byte)物理伤害(4byte)吸血值(4byte)发起方被动技能HP(4byte)目标方被动技能HP(4byte)发起方被动技能MP(4byte)目标方被动技能MP(4byte)
			byte attackerstate = cmdData.readByte();
			if (byTargetType == 1 && die == 1) {
			} else {
				byte byattackerstate = cmdData.readByte();
			}
			byte attackeraction = cmdData.readByte();
			if (byTargetType == 1 && die == 1) {
			} else {
				byte byattackeraction = cmdData.readByte();
			}
			byte attackerDirectX = Tools.getClientDirection(cmdData.readByte());
			byte byattackerDirectX = 0;
			if (byTargetType == 1 && die == 1) {
			} else {
				byattackerDirectX = Tools
						.getClientDirection(cmdData.readByte());
			}
			int attackerPosX = cmdData.readInt();
			int attackerPosY = cmdData.readInt();
			if (byTargetType == 1 && die == 1) {
			} else {
				byattackerPosX = cmdData.readInt();
				byattackerPosY = cmdData.readInt();
				// Tools.printLog("目标方坐标：：：" + byattackerPosX + "," +
				// byattackerPosY);
			}
			byte blshowDouble = cmdData.readByte();
			int iIceDamage = cmdData.readInt();
			int iFireDamage = cmdData.readInt();
			int iPoisionDamage = cmdData.readInt();
			int iFisDamage = cmdData.readInt();
			int iGetBloodDamage = cmdData.readInt();
			// System.out.println("冰伤：：" + iIceDamage + "，火伤：：" + iFireDamage +
			// "，毒伤：：" + iPoisionDamage + "，物理伤害：：" + iFisDamage);
			// int attackerSkillHp = cmdData.readInt();
			int byattackerSkillHp = 0;
			// int attackerSkillMp = cmdData.readInt();
			int byattackerSkillMp = 0;
			if (byTargetType == 1 && die == 1) {
			} else {
				byattackerSkillHp = cmdData.readInt();
				byattackerSkillMp = cmdData.readInt();
			}
			// 玩家自己
			int iskilluseX = 0;
			int iskilluseY = 0;
			int iskillobjX = 0;
			int iskillobjY = 0;
			if (byInitiatorAttacker == 2) {
				// 攻击方是玩家
				if (lAttackerID == MainLogic.getInstance().gamePlayer.lPlayerID) {
					// 当前玩家在攻击
					MainLogic.getInstance().gamePlayer.iPlayerMaxHP = iAttackerMaxHP;
					MainLogic.getInstance().gamePlayer.iPlayerHP = iAttackerHP;// +
																				// iByDamageValue
																				// >
																				// 0
																				// ?
																				// iAttackerHP
																				// +
																				// iByDamageValue
																				// :
																				// 0;
					MainLogic.getInstance().gamePlayer.iPlayerMaxMP = iAttackerMaxMP;
					MainLogic.getInstance().gamePlayer.iPlayerMP = iAttackerMP;
					// 吸血回复
					if (iGetBloodDamage != 0) {
						MainLogic.damage
								.addDamage(
										(byte) -1,
										MainLogic.damage.GAIN_TYPE_BLOOD,
										iGetBloodDamage,
										false,
										MainLogic.getInstance().gamePlayer.byPlayerDirection,
										(int) MainLogic.getInstance().gamePlayer.iPlayerX
												- MainLogic.gameMap.iMapWorldOffsetX,
										(int) MainLogic.getInstance().gamePlayer.iPlayerY
												- MainLogic.gameMap.iMapWorldOffsetY,
										(short) 60);
					}
					if (Math.abs(attackerPosX
							- MainLogic.getInstance().gamePlayer.iPlayerX) > 32
							|| Math.abs(attackerPosY
									- MainLogic.getInstance().gamePlayer.iPlayerY) > 32) {
						// #if NOKIA_S40V3 || NOKIAN73 || NORMAL_240_400 || MOT0
						// || K790
						// #else
						MainLogic.getInstance().gamePlayer
								.updatePosition(
										attackerPosX,
										attackerPosY,
										MainLogic.getInstance().gamePlayer.byPlayerDirection);
						// #endif
					}
					iskilluseX = MainLogic.getInstance().gamePlayer.iPlayerX;
					iskilluseY = MainLogic.getInstance().gamePlayer.iPlayerY;
					// 目标放已死
					if (die == 1) {
						// 把角色变成站立状态
						// MainLogic.getInstance().gamePlayer.changeAction(Constant.PLAYER_STATE_STAND,
						// MainLogic.getInstance().gamePlayer.byPlayerDirection,
						// true, false);
						// Player.blPlayerAttackOver = true;
						MainLogic.getInstance().clearLockedObj(0, true);
					}
				} else {
					// 同屏内的其他玩家在攻击
					int index = ((Integer) (MainLogic.getInstance().gameOtherplayerArray.repeatTable
							.get(new Long(lAttackerID)))).intValue();
					if (index != -1) {
						if (attackerDie == 1) {
							MainLogic.getInstance().gameOtherplayerArray
									.deleteOther(index);
							break;
						} else {
							MainLogic.getInstance().gameOtherplayerArray.shOtherMaxHps[index] = (short) iAttackerMaxHP;
							MainLogic.getInstance().gameOtherplayerArray.shOtherHps[index] = (short) iAttackerHP;
							MainLogic.getInstance().gameOtherplayerArray.shOtherMaxMps[index] = (short) iAttackerMaxMP;
							MainLogic.getInstance().gameOtherplayerArray.shOtherMps[index] = (short) iAttackerMP;
							// 改变其他玩家的动作和动画/
							MainLogic.getInstance().gameOtherplayerArray.iOtherXs[index] = attackerPosX;
							MainLogic.getInstance().gameOtherplayerArray.iOtherYs[index] = attackerPosY;
							int indexa = actId.indexOf(",");
							if (indexa != -1) {
								// #if NOKIA_S40V3 || NORMAL_240_400 || MOT0 ||
								// K790
								// # actId = actId.substring(0,
								// indexa);//substring(index + 1)
								// #else
								actId = actId.substring(indexa + 1);
								// #endif
							}
							MainLogic.getInstance().gameOtherplayerArray
									.changeAction(
											index,
											(byte) attackerstate,
											Byte.parseByte(actId),
											MainLogic.getInstance().gameOtherplayerArray.byOtherDirection[index]);
							iskilluseX = MainLogic.getInstance().gameOtherplayerArray.iOtherXs[index];
							iskilluseY = MainLogic.getInstance().gameOtherplayerArray.iOtherYs[index];

						}
						// break;
					}
				}
			} else if (byInitiatorAttacker == 1) {
				// 攻击方NPC或是怪物
				int index = ((Integer) (MainLogic.getInstance().gameNpcArray.repeatTable
						.get(new Long(lAttackerID)))).intValue();
				if (index != -1) {
					if (attackerDie == 1) {
						if (lbyAttacherID == MainLogic.getInstance().gamePlayer.lPlayerID) {
							MainLogic.damage
									.addBattleDamage(
											(byte) 1,
											(byte) -1,
											iIceDamage,
											iFireDamage,
											iPoisionDamage,
											iFisDamage,
											byHit,
											blshowDouble,
											MainLogic.getInstance().gamePlayer.byPlayerDirection,
											(int) MainLogic.getInstance().gamePlayer.iPlayerX
													- MainLogic.gameMap.iMapWorldOffsetX,
											(int) MainLogic.getInstance().gamePlayer.iPlayerY
													- MainLogic.gameMap.iMapWorldOffsetY,
											bySkillType, (short) 60);
							if (iGetBloodDamage != 0) {
								MainLogic.damage
										.addDamage(
												(byte) -1,
												MainLogic.damage.GAIN_TYPE_BLOOD,
												iGetBloodDamage,
												false,
												MainLogic.getInstance().gamePlayer.byPlayerDirection,
												(int) MainLogic.getInstance().gameNpcArray.iNpcXs[index]
														- MainLogic.gameMap.iMapWorldOffsetX,
												(int) MainLogic.getInstance().gameNpcArray.iNpcYs[index]
														- MainLogic.gameMap.iMapWorldOffsetY,
												-MainLogic.getInstance().gameNpcArray.shNpcHeight[index]);
							}
						}
						MainLogic.getInstance().gameNpcArray.deleteNpc(index);
						break;
					} else {
						MainLogic.getInstance().gameNpcArray.shNpcMaxHps[index] = (short) iAttackerMaxHP;
						MainLogic.getInstance().gameNpcArray.shNpcHps[index] = (short) iAttackerHP;
						MainLogic.getInstance().gameNpcArray.shNpcMaxMps[index] = (short) iAttackerMaxMP;
						MainLogic.getInstance().gameNpcArray.shNpcMps[index] = (short) iAttackerMP;
						MainLogic.getInstance().gameNpcArray
								.changeAction(
										index,
										(byte) attackeraction,
										MainLogic.getInstance().gameNpcArray.byNpcDirection[index]);
						iskilluseX = MainLogic.getInstance().gameNpcArray.iNpcXs[index];
						iskilluseY = MainLogic.getInstance().gameNpcArray.iNpcYs[index];
						// 如果被攻击是当前的玩家，显示伤害
						if (lbyAttacherID == MainLogic.getInstance().gamePlayer.lPlayerID) {
							MainLogic.damage
									.addBattleDamage(
											(byte) 1,
											(byte) -1,
											iIceDamage,
											iFireDamage,
											iPoisionDamage,
											iFisDamage,
											byHit,
											blshowDouble,
											MainLogic.getInstance().gamePlayer.byPlayerDirection,
											(int) MainLogic.getInstance().gamePlayer.iPlayerX
													- MainLogic.gameMap.iMapWorldOffsetX,
											(int) MainLogic.getInstance().gamePlayer.iPlayerY
													- MainLogic.gameMap.iMapWorldOffsetY,
											bySkillType, (short) 60);
							if (iGetBloodDamage != 0) {
								MainLogic.damage
										.addDamage(
												(byte) -1,
												MainLogic.damage.GAIN_TYPE_BLOOD,
												iGetBloodDamage,
												false,
												MainLogic.getInstance().gamePlayer.byPlayerDirection,
												(int) MainLogic.getInstance().gameNpcArray.iNpcXs[index]
														- MainLogic.gameMap.iMapWorldOffsetX,
												(int) MainLogic.getInstance().gameNpcArray.iNpcYs[index]
														- MainLogic.gameMap.iMapWorldOffsetY,
												-MainLogic.getInstance().gameNpcArray.shNpcHeight[index]);
							}
						}
					}
					// break;
				}
			} else if (byInitiatorAttacker == 0) {
				// 攻击方是其他类型
			}
			// 被攻击方
			if (byTargetType == 2) {
				// 被攻击方是玩家
				if (lbyAttacherID == MainLogic.getInstance().gamePlayer.lPlayerID) {
					if (!MainCanvas.mainView.bStartIntoBattle) {// 在屏幕中显示玩家正在受到攻击
						MainCanvas.mainView.initByAttack();
					}
					// 被攻击的是当前玩家
					MainLogic.getInstance().gamePlayer.iPlayerMaxHP = ibyAttackerMaxHP;
					MainLogic.getInstance().gamePlayer.iPlayerHP = ibyAttackerHP;
					MainLogic.getInstance().gamePlayer.iPlayerMaxMP = ibtyAttackerMaxMP;
					MainLogic.getInstance().gamePlayer.iPlayerMP = ibyAttackerMP;
					// 添加伤害数字
					MainLogic.damage
							.addBattleDamage(
									(byte) 1,
									(byte) -1,
									iIceDamage,
									iFireDamage,
									iPoisionDamage,
									iFisDamage,
									byHit,
									blshowDouble,
									MainLogic.getInstance().gamePlayer.byPlayerDirection,
									(int) MainLogic.getInstance().gamePlayer.iPlayerX
											- MainLogic.gameMap.iMapWorldOffsetX,
									(int) MainLogic.getInstance().gamePlayer.iPlayerY
											- MainLogic.gameMap.iMapWorldOffsetY,
									bySkillType, (short) 60);
					iskillobjX = MainLogic.getInstance().gamePlayer.iPlayerX;
					iskillobjY = MainLogic.getInstance().gamePlayer.iPlayerY;
					if (Math.abs(byattackerPosX
							- MainLogic.getInstance().gamePlayer.iPlayerX) > 32
							|| Math.abs(byattackerPosY
									- MainLogic.getInstance().gamePlayer.iPlayerY) > 32) {
						// #if NOKIA_S40V3 || NOKIAN73 || NORMAL_240_400 || MOT0
						// || K790
						// #else
						MainLogic.getInstance().gamePlayer
								.updatePosition(
										byattackerPosX,
										byattackerPosY,
										MainLogic.getInstance().gamePlayer.byPlayerDirection);
						// #endif
					}
					// if (die == 1) {
					// MainLogic.getInstance().gamePlayer.byPlayerState =
					// Constant.PLAYER_STATE_DIE;
					// }
				} else {
					// 被攻击的是同屏的其他玩家
					int index = ((Integer) (MainLogic.getInstance().gameOtherplayerArray.repeatTable
							.get(new Long(lbyAttacherID)))).intValue();
					if (index != -1) {
						if (die == 1) {
							if (lAttackerID == MainLogic.getInstance().gamePlayer.lPlayerID) {
								MainLogic.damage
										.addBattleDamage(
												(byte) 1,
												(byte) -1,
												iIceDamage,
												iFireDamage,
												iPoisionDamage,
												iFisDamage,
												byHit,
												blshowDouble,
												MainLogic.getInstance().gamePlayer.byPlayerDirection,
												(int) MainLogic.getInstance().gameOtherplayerArray.iOtherXs[index]
														- MainLogic.gameMap.iMapWorldOffsetX,
												(int) MainLogic.getInstance().gameOtherplayerArray.iOtherYs[index]
														- MainLogic.gameMap.iMapWorldOffsetY,
												bySkillType, (short) 60);
							}
							MainLogic.getInstance().gameOtherplayerArray.byOtherState[index] = Constant.PLAYER_STATE_DIE;
							break;
						} else {
							MainLogic.getInstance().gameOtherplayerArray.shOtherMaxHps[index] = (short) ibyAttackerMaxHP;
							MainLogic.getInstance().gameOtherplayerArray.shOtherHps[index] = (short) ibyAttackerHP;
							MainLogic.getInstance().gameOtherplayerArray.shOtherMaxMps[index] = (short) ibtyAttackerMaxMP;
							MainLogic.getInstance().gameOtherplayerArray.shOtherMps[index] = (short) ibyAttackerMP;
							MainLogic.addLockedInfor(-1, -1, ibyAttackerMaxHP,
									ibyAttackerHP, ibtyAttackerMaxMP,
									ibyAttackerMP, (byte) -1, -1);
							MainLogic.getInstance().gameOtherplayerArray.iOtherXs[index] = byattackerPosX;
							MainLogic.getInstance().gameOtherplayerArray.iOtherYs[index] = byattackerPosY;
							iskillobjX = MainLogic.getInstance().gameOtherplayerArray.iOtherXs[index];
							iskillobjY = MainLogic.getInstance().gameOtherplayerArray.iOtherYs[index];
							if (lAttackerID == MainLogic.getInstance().gamePlayer.lPlayerID) {
								MainLogic.damage
										.addBattleDamage(
												(byte) 1,
												(byte) -1,
												iIceDamage,
												iFireDamage,
												iPoisionDamage,
												iFisDamage,
												byHit,
												blshowDouble,
												MainLogic.getInstance().gamePlayer.byPlayerDirection,
												(int) MainLogic.getInstance().gameOtherplayerArray.iOtherXs[index]
														- MainLogic.gameMap.iMapWorldOffsetX,
												(int) MainLogic.getInstance().gameOtherplayerArray.iOtherYs[index]
														- MainLogic.gameMap.iMapWorldOffsetY,
												bySkillType, (short) 60);
							}
						}
					}
				}
			} else if (byTargetType == 1) {
				// 被攻击方方是怪物
				int index = ((Integer) (MainLogic.getInstance().gameNpcArray.repeatTable
						.get(new Long(lbyAttacherID)))).intValue();
				if (index != -1) {
					if (die == 1) {
						if (lAttackerID == MainLogic.getInstance().gamePlayer.lPlayerID) {
							MainLogic.damage
									.addBattleDamage(
											(byte) 2,
											(byte) -1,
											iIceDamage,
											iFireDamage,
											iPoisionDamage,
											iFisDamage,
											byHit,
											blshowDouble,
											MainLogic.getInstance().gamePlayer.byPlayerDirection,
											(int) MainLogic.getInstance().gameNpcArray.iNpcXs[index]
													- MainLogic.gameMap.iMapWorldOffsetX,
											(int) MainLogic.getInstance().gameNpcArray.iNpcYs[index]
													- MainLogic.gameMap.iMapWorldOffsetY,
											bySkillType,
											MainLogic.getInstance().gameNpcArray.shNpcHeight[index]);
						}
						MainLogic.getInstance().gameNpcArray.deleteNpc(index);
						break;
					} else {
						MainLogic.getInstance().gameNpcArray.shNpcMaxHps[index] = (short) ibyAttackerMaxHP;
						MainLogic.getInstance().gameNpcArray.shNpcHps[index] = (short) ibyAttackerHP;
						MainLogic.getInstance().gameNpcArray.shNpcMaxMps[index] = (short) ibtyAttackerMaxMP;
						MainLogic.getInstance().gameNpcArray.shNpcMps[index] = (short) ibyAttackerMP;
						MainLogic.addLockedInfor(-1, -1, ibyAttackerMaxHP,
								ibyAttackerHP, ibtyAttackerMaxMP,
								ibyAttackerMP, (byte) -1, -1);
						MainLogic.getInstance().gameNpcArray.iNpcXs[index] = byattackerPosX;
						MainLogic.getInstance().gameNpcArray.iNpcYs[index] = byattackerPosY;
						iskillobjX = MainLogic.getInstance().gameNpcArray.iNpcXs[index];
						iskillobjY = MainLogic.getInstance().gameNpcArray.iNpcYs[index];
						if (lAttackerID == MainLogic.getInstance().gamePlayer.lPlayerID) {
							MainLogic.damage
									.addBattleDamage(
											(byte) 2,
											(byte) -1,
											iIceDamage,
											iFireDamage,
											iPoisionDamage,
											iFisDamage,
											byHit,
											blshowDouble,
											MainLogic.getInstance().gamePlayer.byPlayerDirection,
											(int) MainLogic.getInstance().gameNpcArray.iNpcXs[index]
													- MainLogic.gameMap.iMapWorldOffsetX,
											(int) MainLogic.getInstance().gameNpcArray.iNpcYs[index]
													- MainLogic.gameMap.iMapWorldOffsetY,
											bySkillType,
											MainLogic.getInstance().gameNpcArray.shNpcHeight[index]);
						}
					}
				}
			} else if (byTargetType == 0) {
				// 被攻击方是其他的类型
			}
			// 1101增加光效
			if (!skillKey.equals("")) {
				int index = MainLogic.getInstance().gameNpcArray
						.getNpc(lAttackerID);
				if (index != -1) {
					int indexa = actId.indexOf(",");
					if (indexa != -1) {
						// #if NOKIA_S40V3 || NORMAL_240_400 || MOT0 || K790
						// # actId = actId.substring(indexa +
						// 1);//substring(index + 1)
						// #else
						actId = actId.substring(0, indexa);
						// #endif
					}
					MainLogic.getInstance().gameNpcArray.changeAction(index,
							Byte.parseByte(actId), attackDrict);
					if (MainLogic.getInstance().uiEquipment.isopenset[10]
							&& iSkillID != 0) {
						MainLogic.getInstance().aSkillManager
								.addSkillAni(
										SkillManager.getSkillIndex(iSkillID),
										Constant.SKILL_TYPE_NPC,
										(byte) -1,
										skillKey,
										iSkillID,
										iskilluseX,
										iskilluseY,
										iskillobjX,
										iskillobjY,
										MainLogic.getInstance().gameNpcArray.byNpcDirection[index]);
					}
				}
				if (byTargetType == 2) {
					if (lbyAttacherID == MainLogic.getInstance().gamePlayer.lPlayerID) {
						index = MainLogic.getInstance().gameOtherplayerArray
								.getOther(lAttackerID);
						if (index != -1 && iSkillID != 0) {
							if (MainLogic.getInstance().uiEquipment.isopenset[10]) {
								MainLogic.getInstance().aSkillManager
										.addSkillAni(
												SkillManager
														.getSkillIndex(iSkillID),
												Constant.SKILL_TYPE_OTHERPLAYER,
												(byte) -1,
												skillKey,
												iSkillID,
												iskilluseX,
												iskilluseY,
												iskillobjX,
												iskillobjY,
												MainLogic.getInstance().gameOtherplayerArray.byOtherDirection[index]);
							}
						}
					}
				}
			}
			if (die == 1 && byTargetType == 1) {
			}
			skillKey = null;
			actId = null;
			break;
		case Constant.MSG_NET_CMD_DELETE_NPC:
			try {
				long npcid = cmdData.readLong();
				if ((MainLogic.getInstance().gameNpcArray.repeatTable
						.get(new Long(npcid))) != null) {
					int index = (int) ((Integer) (MainLogic.getInstance().gameNpcArray.repeatTable
							.get(new Long(npcid)))).intValue();
					MainLogic.getInstance().gameNpcArray.deleteNpc(index);
				}
			} catch (Exception e) {
				if (Constant.DEBUG) {
					e.printStackTrace();
				}
			}
			break;
		case Constant.MSG_NET_CMD_DELETE_PLAYER:
			type = cmdData.readByte();
			// Tools.printLog("是否需要循环：：：" + type);
			short nums = cmdData.readShort();
//			long playerID;
			if (type == 1) {
				for (j = 0; j < nums; j++) {
					playerID = cmdData.readLong();
					if (((Integer) (MainLogic.getInstance().gameOtherplayerArray.repeatTable
							.get(new Long(playerID)))) != null) {
						MainLogic.getInstance().gameOtherplayerArray
								.deleteOther((int) ((Integer) (MainLogic
										.getInstance().gameOtherplayerArray.repeatTable
										.get(new Long(playerID)))).intValue());
					}
					if (((Integer) (MainLogic.getInstance().gameNpcArray.repeatTable
							.get(new Long(playerID)))) != null) {
						Tools.printLog("删除NPCid：：：：" + playerID);
						MainLogic.getInstance().gameNpcArray
								.deleteNpc((int) ((Integer) (MainLogic
										.getInstance().gameNpcArray.repeatTable
										.get(new Long(playerID)))).intValue());
					}

				}
			} else if (type == 2)// 全部删除
			{
				MainLogic.getInstance().gameOtherplayerArray.clearOtherPlayer();
				MainLogic.getInstance().gameNpcArray.clearNpc();
				MainLogic.getInstance().gameNpcArray.blNpcResInitOver = true;
			}
			break;

		case Constant.MSG_NET_CMD_OPEN_EQUIP:
			// 打开装备栏
			GameBean.b_WAIT_NET_MSG_BACK = false;
			byte equipIndex,
			byEquipmentPos,
			byGoodsColor,
			byDurability,
			byGoodsJob;
			int iGoodsIconID;
			short shGoodsLevel;
			String sGoodsKey = null;
			String sGoodsName = null;
			stateCode = cmdData.readByte();
			if (stateCode == 1) {
				MainLogic.getInstance().pushState(Constant.GAME_UI_EQUIPMENT,
						true);
				byte equipmentNums = cmdData.readByte();
				long lColumnKey;
				MainLogic.getInstance().uiPackage.equipPackageGoods = new Goods(
						equipmentNums, Constant.ITEM_COLUMN_TYPE_EQUIP);
				for (j = 0; j < equipmentNums; j++) {
					sGoodsName = cmdData.readUTF();
					iGoodsIconID = cmdData.readInt();
					shGoodsLevel = cmdData.readShort();
					byEquipmentPos = cmdData.readByte();
					byGoodsColor = cmdData.readByte();
					equipIndex = MainLogic.getInstance().uiPackage.equipPackageGoods
							.getEquipColumnIndex(byEquipmentPos);
					byDurability = cmdData.readByte();
					byJob = cmdData.readByte();
					byte byBind = cmdData.readByte();
					MainLogic.getInstance().uiPackage.equipPackageGoods
							.addEquipment(equipIndex, true, sGoodsName,
									iGoodsIconID, byEquipmentPos, byGoodsColor,
									(byte) shGoodsLevel, byDurability, byJob,
									byBind);
				}
				short equipNum = cmdData.readShort();
				MainLogic.getInstance().uiPackage.packageGoods = new Goods(
						(short) (equipmentNums + equipNum),
						Constant.ITEM_COLUMN_TYPE_EQUIP_PACKAGE);
				for (j = 0; j < equipNum; j++) {
					lColumnKey = cmdData.readLong();
					sGoodsName = cmdData.readUTF();
					short shStackNum = cmdData.readShort();
					iGoodsIconID = cmdData.readInt();
					shGoodsLevel = cmdData.readShort();
					byEquipmentPos = cmdData.readByte();
					byGoodsColor = cmdData.readByte();
					byGoodsJob = cmdData.readByte();
					byDurability = cmdData.readByte();
					byte byBind = cmdData.readByte();
					MainLogic.getInstance().uiPackage.packageGoods.addGoods(
							(short) j, true, lColumnKey, (short) -1,
							sGoodsName, shStackNum, iGoodsIconID,
							byEquipmentPos, byGoodsColor, byGoodsJob,
							(byte) -1, byBind, "", shGoodsLevel, -1,
							byDurability, null);
				}
				sGoodsName = null;
				MainLogic.getInstance().uiPackage.setBagTotalPage();
			} else {
				MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
						"提示", "打开装备栏失败!");
			}
			break;
		}
	}

	public void processMessage2_1(int msgId, DataInputStream cmdData) throws IOException {
    	byte stateCode,type;
        int j = 0;
        long playerID = 0;
        switch (msgId) {
                case Constant.MSG_NET_CMD_SET_QUICK:
                    int setnum = cmdData.readByte();
//                    System.out.println("setnum   " + setnum);
                    if (setnum > 0) {
                        String setkey;
                        String setname;
                        String setDescription;
                        for (j = 0; j < setnum; j++) {
                            byte setindex = cmdData.readByte();
//                            System.out.println("setindex   " + setindex);
                            byte settype = cmdData.readByte();
//                            System.out.println("settype   " + settype);
                            if (settype != 0) {
                                MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][0] = "" + setindex;
                                MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][1] = "" + settype;
                                if (settype == 1) {//技能
                                    setkey = cmdData.readUTF();
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][3] = setkey;
//                                    System.out.println("setkey   " + setkey);
                                    int seticonid = cmdData.readInt();
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][2] = "" + seticonid;
//                                    System.out.println("seticonid   " + seticonid);
                                    setname = cmdData.readUTF();
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][4] = setname;
//                                    System.out.println("setname   " + setname);
                                    setDescription = cmdData.readUTF();
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][5] = setDescription;
//                                    System.out.println("setDescription   " + setDescription);
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][6] = "" + 0;
                                    MainLogic.getInstance().uiInterFace.gameSet.getQuickSetIcon(setindex, "" + seticonid);
                                    //异常处理
                                    if (seticonid == 0 || setname.equals("") || setDescription.equals("")) {
                                        for (int a = 0; a < MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex].length; a++) {
                                            MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][a] = null;
                                        }
                                        MainLogic.getInstance().uiInterFace.gameSet.getQuickSetIcon(setindex, null);
                                        MainLogic.getInstance().uiInterFace.gameSet.quickSetTime[setindex][0] = 0;
                                        MainLogic.getInstance().uiInterFace.gameSet.quickSetTime[setindex][1] = 0;
                                    }
                                } else if (settype == 2) {//物品
                                    long setid = cmdData.readLong();
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][3] = "" + setid;
//                                    System.out.println("setid   " + setid);
                                    int seticonid = cmdData.readInt();
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][2] = "" + seticonid;
//                                    System.out.println("seticonid   " + seticonid);
                                    setname = cmdData.readUTF();
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][4] = setname;
//                                    System.out.println("setname   " + setname);
                                    setDescription = cmdData.readUTF();
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][5] = setDescription;
//                                    System.out.println("setDescription   " + setDescription);
                                    byte setitemsnum = cmdData.readByte();
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][6] = "" + setitemsnum;
                                    MainLogic.getInstance().uiInterFace.gameSet.getQuickSetIcon(setindex, "" + seticonid);
                                    int totaleTime = cmdData.readInt();
                                    MainLogic.getInstance().uiInterFace.gameSet.quickSetTime[setindex][1] = totaleTime * 1000;
                                    //异常处理
                                    if (seticonid == 0 || setname.equals("") || setDescription.equals("")) {
                                        for (int a = 0; a < MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex].length; a++) {
                                            MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][a] = null;
                                        }
                                        MainLogic.getInstance().uiInterFace.gameSet.getQuickSetIcon(setindex, null);
                                        MainLogic.getInstance().uiInterFace.gameSet.quickSetTime[setindex][0] = 0;
                                        MainLogic.getInstance().uiInterFace.gameSet.quickSetTime[setindex][1] = 0;
                                    }
                                } else if (settype == 3) {//功能
                                    byte function_id = cmdData.readByte();
                                    function_id -= 1;
//                                    System.out.println("function_id  " + (function_id));
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][3] = "" + function_id;
//                                    System.out.println("QuickSet[setindex][3]  " + MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][3]);
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][2] = MainLogic.getInstance().uiInterFace.gameSet.getFuncIconID(function_id);
//                                    System.out.println("QuickSet[setindex][2]  " + MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][2]);
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][4] = MainLogic.getInstance().uiInterFace.gameSet.getFuncName(function_id);
//                                    System.out.println("QuickSet[setindex][4]  " + MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][4]);
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][5] = "";
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][6] = "" + 0;
                                    MainLogic.getInstance().uiInterFace.gameSet.getQuickSetIcon(setindex, MainLogic.getInstance().uiInterFace.gameSet.getFuncIconID(function_id));
                                    //异常处理
                                    if (function_id < 0) {
                                        for (int a = 0; a < MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex].length; a++) {
                                            MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][a] = null;
                                        }
                                        MainLogic.getInstance().uiInterFace.gameSet.getQuickSetIcon(setindex, null);
                                        MainLogic.getInstance().uiInterFace.gameSet.quickSetTime[setindex][0] = 0;
                                        MainLogic.getInstance().uiInterFace.gameSet.quickSetTime[setindex][1] = 0;
                                    }
                                }
                            } else {
                                for (int a = 0; a < MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex].length; a++) {
                                    MainLogic.getInstance().uiInterFace.gameSet.QuickSet[setindex][a] = null;
                                }
                                MainLogic.getInstance().uiInterFace.gameSet.getQuickSetIcon(setindex, null);
                                MainLogic.getInstance().uiInterFace.gameSet.quickSetTime[setindex][0] = 0;
                                MainLogic.getInstance().uiInterFace.gameSet.quickSetTime[setindex][1] = 0;
                            }
                        }
                        setkey = null;
                        setname = null;
                        setDescription = null;
                    }
                    break;
                case Constant.MSG_NET_GET_MERIDIAN_DESC:
                    stateCode = cmdData.readByte();
                    if (stateCode == 1) {
                        int needpoints = cmdData.readInt();
                        String description = cmdData.readUTF();
                        int nextneedpoints = cmdData.readInt();
                        String nextdescription = cmdData.readUTF();
                        MainLogic.getInstance().uiEquipment.getmeridianDesc(needpoints, description, nextneedpoints, nextdescription);
                        nextdescription = null;
                        description = null;
                    }
                    break;
                case Constant.MSG_NET_LEARN_MERIDIAN:
                    //学习经脉
                    stateCode = cmdData.readByte();
                    if (stateCode == 1) {
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_MERIDIAN, Constant.SOCKET_MSG_TYPE_LOGIC);
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "学习经脉成功!");
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "前置经脉未开启!");
                    }
                    break;

            }

    }
    public void processMessage2_2(int msgId, DataInputStream cmdData) throws IOException {
    	byte stateCode;
        int j = 0;
        byte byEquipmentPos = 0,byGoodsJob,byDurability,byGoodsColor;
        String sGoodsName;
        int iGoodsIconID;
        short shGoodsLevel,equipIndex;
        switch (msgId) {

            case Constant.MSG_NET_CMD_USE_EQUIP:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                //s使用装备//穿装备
                int goodsIndex;
                long oldGoodsKey;
                short shGoodsNum;
                byte byGoodsGender,
                 bybind;
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    byte uiType = cmdData.readByte();
                    String[] sGoodsDetail = null;
                    //普通物品栏
                    if (uiType == 0) {
                        goodsIndex = cmdData.readInt();
                        String iEquipmentAvatarID = cmdData.readUTF();
                        //添加装备动画avatar
                        byEquipmentPos = MainLogic.getInstance().uiPackage.packageGoods.getGoodsEquipPlace((short) goodsIndex);
                        MainLogic.getInstance().gamePlayer.addAvatorAni(iEquipmentAvatarID, byEquipmentPos, false);
                        short shComparisonNum = cmdData.readShort();
                        if (shComparisonNum > 0) {
                            sGoodsDetail = new String[shComparisonNum];
                            for (j = 0; j < shComparisonNum; j++) {
                                sGoodsDetail[j] = cmdData.readUTF();
                            }
                        }
                        oldGoodsKey = cmdData.readLong();
                        //没有装备
                        if (oldGoodsKey == 0) {
                            MainLogic.getInstance().uiPackage.packageGoods.deleteGoods((short) goodsIndex);
                        } else {
                            MainLogic.getInstance().uiPackage.packageGoods.deleteGoods((short) goodsIndex);
                            goodsIndex = cmdData.readInt();
                            short googsType = cmdData.readShort();
                            sGoodsName = cmdData.readUTF();
                            shGoodsNum = cmdData.readShort();
                            iGoodsIconID = cmdData.readInt();
                            shGoodsLevel = cmdData.readShort();
                            byEquipmentPos = cmdData.readByte();
                            byGoodsColor = cmdData.readByte();
                            byGoodsJob = cmdData.readByte();
                            byGoodsGender = cmdData.readByte();
                            bybind = cmdData.readByte();
                            byDurability = cmdData.readByte();
                            //添加物品
                            MainLogic.getInstance().uiPackage.packageGoods.addGoods((short) goodsIndex, true, oldGoodsKey, (short) googsType, sGoodsName, (short) 1, iGoodsIconID, byEquipmentPos, (byte) byGoodsColor, (byte) byGoodsJob, (byte) byGoodsGender, (byte) bybind, "", (byte) shGoodsLevel, -1, byDurability, null);

                        }

                        MainLogic.getInstance().uiInterFace.sysMessage.openUNloadEquip(sGoodsDetail);
                        iEquipmentAvatarID = null;
                        sGoodsName = null;
                        sGoodsDetail = null;
                    } else if (uiType == 1) {
                        //装备栏,新的装备
                        goodsIndex = cmdData.readInt();//旧的装备的索引
                        //新的装备名字
                        sGoodsName = cmdData.readUTF();
                        iGoodsIconID = cmdData.readInt();
                        shGoodsLevel = cmdData.readShort();
                        byEquipmentPos = cmdData.readByte();
                        byGoodsColor = cmdData.readByte();
                        String EquipmentAvatarID = cmdData.readUTF();
                        byDurability = cmdData.readByte();
                        short shComparisonNum = cmdData.readShort();
                        if (shComparisonNum > 0) {
                            sGoodsDetail = new String[shComparisonNum];
                            for (j = 0; j < shComparisonNum; j++) {
                                sGoodsDetail[j] = cmdData.readUTF();
                            }
                        }
                        MainLogic.getInstance().gamePlayer.addAvatorAni(EquipmentAvatarID, byEquipmentPos, false);
                        oldGoodsKey = cmdData.readLong();
                        //没有装备
                        if (oldGoodsKey == 0) {
                            //删除包裹栏中的装备.以前此位置没有装备装备
                            equipIndex = MainLogic.getInstance().uiPackage.equipPackageGoods.getEquipColumnIndex(byEquipmentPos);
                            MainLogic.getInstance().uiPackage.equipPackageGoods.addEquipment(equipIndex, true, sGoodsName, iGoodsIconID, byEquipmentPos, byGoodsColor, (byte) shGoodsLevel, byDurability, MainLogic.getInstance().uiPackage.packageGoods.getGoodsJob(MainLogic.getInstance().uiPackage.shPos), MainLogic.getInstance().uiPackage.packageGoods.getGoodsBind(MainLogic.getInstance().uiPackage.shPos));
                            MainLogic.getInstance().uiPackage.packageGoods.deleteGoods((short) goodsIndex);
                        } else {
//                         //替换下来的装备放到下面的栏中
                            equipIndex = MainLogic.getInstance().uiPackage.equipPackageGoods.getEquipColumnIndex(byEquipmentPos);
                            byte byBind = MainLogic.getInstance().uiPackage.packageGoods.getGoodsBind(MainLogic.getInstance().uiPackage.shPos);
                            byte byOldBind = MainLogic.getInstance().uiPackage.equipPackageGoods.getGoodsBind(equipIndex);
                            byte byOldGoodsColor = MainLogic.getInstance().uiPackage.equipPackageGoods.getGoodsColor(equipIndex);
                            MainLogic.getInstance().uiPackage.equipPackageGoods.addEquipment(equipIndex, true, sGoodsName, iGoodsIconID, byEquipmentPos, byGoodsColor, (byte) shGoodsLevel, byDurability, (byte) MainLogic.getInstance().gamePlayer.iplayerOccupation, byBind);
                            sGoodsName = cmdData.readUTF();
                            iGoodsIconID = cmdData.readInt();
                            shGoodsLevel = cmdData.readShort();
                            byDurability = cmdData.readByte();
                            //替换下来的装备放到下面的栏中
                            MainLogic.getInstance().uiPackage.packageGoods.addGoods((short) goodsIndex, true, oldGoodsKey, (short) -1, sGoodsName, (short) 1, iGoodsIconID, byEquipmentPos, byOldGoodsColor, (byte) MainLogic.getInstance().gamePlayer.iplayerOccupation, (byte) -1, byOldBind, "", (byte) shGoodsLevel, -1, byDurability, null);
                        }
                        MainLogic.getInstance().uiInterFace.sysMessage.openUNloadEquip(sGoodsDetail);
                        EquipmentAvatarID = null;
                        sGoodsName = null;
                        sGoodsDetail = null;
                    }
                } else {
                    switch (stateCode) {
                        case 0:
                            Tools.printLog("您不能装备这件道具");
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您不能装备这件道具");
                            break;
                        case 2:
                            Tools.printLog("普通物品栏已满，添加到临时栏");
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "普通物品栏已满，添加到临时栏");
                            break;
                        case 3:
                            Tools.printLog(" 普通物品栏和临时栏都满");
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "普通物品栏和临时栏都满");
                            break;
                    }
                }
                break;
            //删除装备
            case Constant.MSG_NET_CMD_DELETE_EQUIP:
                long lColumnKey;
                stateCode = cmdData.readByte();
                GameBean.b_WAIT_NET_MSG_BACK = false;
                if (stateCode == 1) {
                    //缺少一个索引,装备的类别，绑定类型
                    lColumnKey = cmdData.readLong();
                    sGoodsName = cmdData.readUTF();
                    shGoodsNum = cmdData.readShort();
                    iGoodsIconID = cmdData.readInt();
                    shGoodsLevel = cmdData.readShort();
                    byEquipmentPos = cmdData.readByte();
                    byGoodsColor = cmdData.readByte();
                    byGoodsJob = cmdData.readByte();
                    byGoodsGender = cmdData.readByte();
                    byDurability = cmdData.readByte();
                    short tempGoodsIndex = 0;
                    short shGoodsDescNum = cmdData.readShort();
                    String[] sGoodsDetail = null;
                    if (shGoodsDescNum > 0) {
                        sGoodsDetail = new String[shGoodsDescNum];
                        for (j = 0; j < shGoodsDescNum; j++) {
                            sGoodsDetail[j] = cmdData.readUTF();
                        }
                    }
                    //找出一个没有放置物品的位置
                    for (short k = 0; k < MainLogic.getInstance().uiPackage.packageGoods.getMaxColumNum(); k++) {
                        if (!MainLogic.getInstance().uiPackage.packageGoods.checkColumnHasGoods(k)) {
                            tempGoodsIndex = k;
                            break;
                        }
                    }
                    byte byBind = MainLogic.getInstance().uiPackage.equipPackageGoods.getGoodsBind(MainLogic.getInstance().uiPackage.equipPackageGoods.getEquipColumnIndex(byEquipmentPos));
                    MainLogic.getInstance().uiPackage.packageGoods.addGoods(tempGoodsIndex, true, lColumnKey, (byte) -1, sGoodsName, (short) 1, iGoodsIconID, byEquipmentPos, byGoodsColor, byGoodsJob, byGoodsGender, byBind, "", (short) -1, -1, byDurability, null);
                    MainLogic.getInstance().uiPackage.equipPackageGoods.deleteEquipment(byEquipmentPos);
                    MainLogic.getInstance().uiInterFace.sysMessage.openUNloadEquip(sGoodsDetail);
                    sGoodsName = null;
                    sGoodsDetail = null;
                } else {
                    switch (stateCode) {
                        case 0:
                            Tools.printLog("网络连接异常");
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "网络连接异常");
                            break;
                        case 2:
                            Tools.printLog("普通物品栏已满，添加到临时栏");
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "普通物品栏已满，添加到临时栏");
                            break;
                        case 3:
                            Tools.printLog(" 普通物品栏和临时栏都满");
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "普通物品栏和临时栏都满");
                            break;
                    }
                }
                break;
            //状态(byte)开启槽个数(byte)心法个数(byte)心法key(变长)
            //图标key(2byte)名字(变长)描述(变长)
            //心法
            case Constant.MSG_NET_OPEN_KUNGFU:
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    short profNum = -100;//职业技能个数
                    String profKey = "";//职业技能key
                    short proficonKey = -100;//职业技能图标key
                    String profName = "";//职业技能名字
                    byte profType = -100;//职业技能类型//被动，主动
                    //
                    short openNum = -100;//开启槽个数
                    short kungfuNum = -100;//心法个数
                    String kungfuKey = "";//心法key
                    short iconKey = -100;//图标key
                    String kungfuName = "";//名字
                    byte kungfuType = -100;//技能类型//被动，主动
                    //
                    short tong_Num = -100;//帮派技能个数
                    String tongKey = "";//帮派技能key
                    short tongiconKey = -100;//图标key
                    String tong_Name = "";//名字
                    byte tongType = -100;//技能类型//被动，主动
                    //
                    byte skillTypeNum = -100;
                    openNum = cmdData.readShort();
                    MainLogic.getInstance().uiEquipment.getSkillOpenNum(openNum);
                    skillTypeNum = cmdData.readByte();
                    MainLogic.getInstance().pushState(Constant.GAME_UI_SKILL, true);
                    for (int c = 0; c < skillTypeNum; c++) {
                        if (c == 0) {
                            profNum = cmdData.readShort();
                            MainLogic.getInstance().uiEquipment.initProfSkill(profNum);
                            MainLogic.getInstance().uiEquipment.imgArrayProfIcon = new Image[profNum];
                            for (int b = 0; b < profNum; b++) {
                                profKey = cmdData.readUTF();
                                proficonKey = cmdData.readShort();
                                profName = cmdData.readUTF();
                                profType = cmdData.readByte();
                                MainLogic.getInstance().uiEquipment.getProfSkillIcon(b, "" + proficonKey);
                                MainLogic.getInstance().uiEquipment.getProfSkillInformation(b, profNum,
                                        profKey, proficonKey, profName, profType);
                            }
                            profKey = null;
                            profName = null;
                        } else if (c == 1) {
                            kungfuNum = cmdData.readShort();
                            MainLogic.getInstance().uiEquipment.imgArraykungfuIcon = new Image[kungfuNum];
                            MainLogic.getInstance().uiEquipment.initSkill(kungfuNum);
                            for (int a = 0; a < kungfuNum; a++) {
                                kungfuKey = cmdData.readUTF();
                                iconKey = cmdData.readShort();
                                kungfuName = cmdData.readUTF();
                                kungfuType = cmdData.readByte();
                                MainLogic.getInstance().uiEquipment.getSkillInformation(
                                        a, kungfuNum, kungfuKey, iconKey,
                                        kungfuName, kungfuType);
                                MainLogic.getInstance().uiEquipment.getkungfuSkillIcon(a, "" + iconKey);
                            }
                            kungfuKey = null;
                            kungfuName = null;
                        } else if (c == 2) {
                            tong_Num = cmdData.readShort();
                            MainLogic.getInstance().uiEquipment.inittongSkill(tong_Num);
                            MainLogic.getInstance().uiEquipment.imgArrayTongIcon = new Image[tong_Num];
                            for (int b = 0; b < tong_Num; b++) {
                                tongKey = cmdData.readUTF();
                                tongiconKey = cmdData.readShort();
                                tong_Name = cmdData.readUTF();
                                tongType = cmdData.readByte();
                                MainLogic.getInstance().uiEquipment.getTongSkillIcon(b, "" + tongiconKey);
                                MainLogic.getInstance().uiEquipment.gettongSkillInformation(b, tong_Num,
                                        tongKey, tongiconKey, tong_Name, tongType);
                            }
                            tongKey = null;
                            tong_Name = null;
                        }
                    }
                }
                break;
            case Constant.MSG_NET_CHECK_SKILL:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                String skill_name = cmdData.readUTF();
                byte now_level = cmdData.readByte();
                byte highest_level = cmdData.readByte();
                byte skill_type = cmdData.readByte();
                int sp_num = cmdData.readInt();
                int cd_num = cmdData.readInt();
                String skill_Description = cmdData.readUTF();
                if (GameBean.BY_PRE_GAME_UI_STATE == Constant.GAME_UI_GAMESET_QUICKEYS) {
                    MainLogic.getInstance().uiInterFace.gameSet.getskillDescription(skill_name, now_level, highest_level, skill_type, sp_num, cd_num, skill_Description);
                } else if (GameBean.BY_PRE_GAME_UI_STATE == Constant.GAME_UI_SKILL) {
                    MainLogic.getInstance().uiEquipment.getskillDescription(skill_name, now_level, highest_level, skill_type, sp_num, cd_num, skill_Description);
                }
                GameBean.BY_PRE_GAME_UI_STATE = -1;
                skill_name = null;
                skill_Description = null;
                break;

            case Constant.MSG_NET_CMD_CMD_NOTICE:
                byte Place;
                byte noticeType;
                String noticeTitle = "";
                String noticeText = "";
                Place = cmdData.readByte();
//                System.out.println("Place  ::  " + Place);
                noticeType = cmdData.readByte();
//                System.out.println("noticeType  ::  " + noticeType);
                noticeTitle = cmdData.readUTF();//
//                System.out.println("noticeTitle  ::  " + noticeTitle);
                noticeText = cmdData.readUTF();//
//                System.out.println("notice  ::  " + noticeText);
                if (Place == 1) {
                    if (!noticeText.equals("")) {
                        if (MainLogic.getInstance().uiEquipment.NoticeListState == 0) {
                            MainLogic.getInstance().uiInterFace.sysMessage.initNotice("公告", noticeText, (byte) 0);
                        } else {
                            MainLogic.getInstance().uiInterFace.sysMessage.initNotice("公告", noticeText, (byte) 1);
                            MainLogic.getInstance().uiEquipment.NoticeListState = 0;
                        }
                    }
                } else {
                    MainLogic.getInstance().uiInterFace.sMarquee = noticeText;
                }
                break;
            case Constant.MSG_NET_CMD_NOTICE_LIST:
                byte allNotice_num = cmdData.readByte();
//                System.out.println("allNotice_num  ::  " + allNotice_num);
                byte Notice_num = cmdData.readByte();
//                System.out.println("Notice_num  ::  " + Notice_num);
                MainLogic.getInstance().uiEquipment.noticListtype_1 = new String[1][5];
                MainLogic.getInstance().uiEquipment.noticListtype_2 = new String[1][5];
                MainLogic.getInstance().uiEquipment.Listtype1_index = 0;
                MainLogic.getInstance().uiEquipment.Listtype2_index = 0;
                for (int a = 0; a < Notice_num; a++) {
                    long Notice_id = cmdData.readLong();
//                    System.out.println(a + "    " + "Notice_id  ::  " + Notice_id);
                    Place = cmdData.readByte();
//                    System.out.println(a + "    " + "Place  ::  " + Place);
                    noticeType = cmdData.readByte();
//                    System.out.println(a + "    " + "noticeType  ::  " + noticeType);
                    byte Notice_order = cmdData.readByte();
//                    System.out.println(a + "    " + "Notice_order  ::  " + Notice_order);
                    noticeTitle = cmdData.readUTF();//
//                    System.out.println(a + "    " + "noticeTitle  ::  " + noticeTitle);
                    MainLogic.getInstance().uiEquipment.getNoticeList(Notice_id, Place, noticeType, Notice_order, noticeTitle);
                }
                MainLogic.getInstance().pushState(Constant.GAME_UI_NOTICE_LIST, true);
                break;
            case Constant.MSG_NET_CMD_MAIL_HINT: //信件提示
                short email_num = 0;
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    email_num = cmdData.readShort();
                    MainLogic.getInstance().uiInterFace.isReceiveEmail = true;
                    MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, "收到" + email_num + "封新邮件。");
                } else if (stateCode == 2) {
//                    System.out.println("收件箱信件数量超过40封");
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "收件箱信件数量超过40封，请清理收件箱!");
                } else if (stateCode == 3) {
//                    System.out.println("收件箱已满");
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "收件箱已满，请清理收件箱，否则不能查收新邮件!");
                }
                break;
            case Constant.MSG_NET_CMD_MAIL_CHECKUSER://判断收件人是否存在
                stateCode = cmdData.readByte();
                MainLogic.getInstance().uiEquipment.checkUser = stateCode;
//                System.out.println("checkUser :::: " + MainLogic.getInstance().uiEquipment.checkUser);
                MainLogic.getInstance().uiEquipment.showSysMessage = false;
                break;
            case Constant.MSG_NET_CMD_MAIL_POST://发送邮件
                stateCode = cmdData.readByte();
//                System.out.println("发邮件");
                if (stateCode == 1) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "邮件发送成功!");
                    MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                } else {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "邮件发送失败!");
                }
                break;
            case Constant.MSG_NET_CMD_MAIL_OPEARTION://邮件操作
                GameBean.b_WAIT_NET_MSG_BACK = false;
                byte opeartionType = 0;//返回的操作类型
                short allmail_num;
                byte mail_num = 0;//信件数量
                long mail_id;//信件ID
                String sendmail_name;//发件人
                String mail_title;//标题
                String mail_content;//内容
                long mail_money = 0;//金钱
                String mail_accessory;//附件
                byte mail_days;//天数
                byte mailexpired_days;//过期天数
                byte mail_state;//0：未阅读过的邮件,1：打开的邮件,2：锁定的邮件
                byte addgoods;//0:没有附件,1:有附件
                opeartionType = cmdData.readByte();
//                System.out.println("opeartionType   " + opeartionType);
                stateCode = cmdData.readByte();//状态
//                System.out.println("stateCode   " + stateCode);
//                System.out.println("opeartionType   :::  " + opeartionType);
//                System.out.println("stateCode   :::  " + stateCode);
//                System.out.println("operationmail_index:::" + MainLogic.getInstance().uiEquipment.operationmail_index);
                if (opeartionType == 1) {
                    if (stateCode == 4) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "背包空间不足!");
                    }
                }
                if (stateCode == 1) {
                    switch (opeartionType) {
                        case 0://打开邮件
                            sendmail_name = cmdData.readUTF();//发件人
                            mail_title = cmdData.readUTF();//标题
                            mail_content = cmdData.readUTF();//内容
                            mail_money = cmdData.readLong();//钱
                            mail_accessory = cmdData.readUTF();//附件
                            mailexpired_days = cmdData.readByte();//过期天数
                            MainLogic.getInstance().uiEquipment.getViewEmail(sendmail_name, mail_title, mail_content, (int) mail_money, mail_accessory, mailexpired_days);
                            break;
                        case 1://收取附件
                            MainLogic.getInstance().uiEquipment.ReceiveEmail[MainLogic.getInstance().uiEquipment.operationmail_index][5] = "0";
                            MainLogic.getInstance().uiEquipment.viewEmail_index = 6;
                            MainLogic.getInstance().uiEquipment.money_gold = 0;
                            MainLogic.getInstance().uiEquipment.money_silver = 0;
                            MainLogic.getInstance().uiEquipment.money_copper = 0;
                            MainLogic.getInstance().uiEquipment.getemailItems = new Goods((short) 1, Constant.ITEM_COLUMN_TYPE_COMMON);
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "收取附件成功!");
                            break;
                        case 2://锁定
                            MainLogic.getInstance().uiEquipment.ReceiveEmail[MainLogic.getInstance().uiEquipment.operationmail_index][0] = "2";
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "锁定邮件成功!");
                            MainLogic.getInstance().pushState(Constant.GAME_UI_RECEIVE_EMAIL, true);
                            MainLogic.getInstance().uiEquipment.ReceiveEmail_index = 0;
                            MainLogic.getInstance().uiEquipment.Receive_CurrentPage = 0;
                            break;
                        case 3://
                            MainLogic.getInstance().uiEquipment.ReceiveEmail[MainLogic.getInstance().uiEquipment.operationmail_index][0] = "1";
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "解锁邮件成功!");
                            MainLogic.getInstance().pushState(Constant.GAME_UI_RECEIVE_EMAIL, true);
                            MainLogic.getInstance().uiEquipment.ReceiveEmail_index = 0;
                            MainLogic.getInstance().uiEquipment.Receive_CurrentPage = 0;
                            break;
                        case 4://删除
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "删除邮件成功!");
                            MainLogic.getInstance().uiEquipment.deletonemail(MainLogic.getInstance().uiEquipment.operationmail_index);
                            MainLogic.getInstance().pushState(Constant.GAME_UI_RECEIVE_EMAIL, true);
                            MainLogic.getInstance().uiEquipment.ReceiveEmail_index = 0;
                            MainLogic.getInstance().uiEquipment.Receive_CurrentPage = 0;
                            break;
                        case 5://清空收件箱
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "清空收件箱成功!");
                            MainLogic.getInstance().uiEquipment.deletallEmail();
                            MainLogic.getInstance().pushState(Constant.GAME_UI_RECEIVE_EMAIL, true);
                            MainLogic.getInstance().uiEquipment.ReceiveEmail_index = 0;
                            MainLogic.getInstance().uiEquipment.Receive_CurrentPage = 0;
                            break;
                        case 6://清除所有已读邮件
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "清空收件箱成功!");
                            MainLogic.getInstance().uiEquipment.deletHasreadEmail();
                            MainLogic.getInstance().pushState(Constant.GAME_UI_RECEIVE_EMAIL, true);
                            MainLogic.getInstance().uiEquipment.ReceiveEmail_index = 0;
                            MainLogic.getInstance().uiEquipment.Receive_CurrentPage = 0;
                            break;
                        case 7://查看邮件列表
                            MainLogic.getInstance().uiInterFace.isReceiveEmail = false;
                            allmail_num = cmdData.readShort();
//                            System.out.println("allmail_num   " + allmail_num);
                            mail_num = cmdData.readByte();
//                            System.out.println("mail_num   " + mail_num);
                            MainLogic.getInstance().uiEquipment.init();
                            if (mail_num > 0) {
                                MainLogic.getInstance().uiEquipment.ReceiveEmail = new String[mail_num][6];

                                for (int c = 0; c < mail_num; c++) {
                                    mail_id = cmdData.readLong();//信件ID
                                    sendmail_name = cmdData.readUTF();//发件人
                                    mail_title = cmdData.readUTF();//标题
                                    mail_days = cmdData.readByte();//天数
                                    mail_state = cmdData.readByte();
                                    addgoods = cmdData.readByte();
                                    MainLogic.getInstance().uiEquipment.getReceiveEmail(c, mail_state,
                                            sendmail_name, mail_title, mail_days, (int) mail_id, addgoods);
                                }
                            } else {
                                MainLogic.getInstance().uiEquipment.ReceiveEmail = null;
                            }
                            MainLogic.getInstance().pushState(Constant.GAME_UI_RECEIVE_EMAIL, true);
                            break;
                    }

                    sendmail_name = null;//发件人
                    mail_title = null;//标题
                    mail_content = null;//内容
                    mail_accessory = null;//附件
                }
                break;
            case Constant.MSG_NET_CMD_MAIL_MONEY://查询邮寄金钱
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                long sendmail_money = cmdData.readLong();
                if (stateCode == 1) {
                    if (MainLogic.getInstance().uiEquipment.sendEmail_title.equals("")) {
                        if (MainLogic.getInstance().uiEquipment.sendEmail_text.length() > 8) {
                            MainLogic.getInstance().uiEquipment.sendEmail_title = MainLogic.getInstance().uiEquipment.sendEmail_text.substring(0, 8);//标题
                        } else {
                            MainLogic.getInstance().uiEquipment.sendEmail_title = MainLogic.getInstance().uiEquipment.sendEmail_text;//标题
                        }
                    }
                    MainLogic.getInstance().uiEquipment.sendEmail_money = (int) sendmail_money;
                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_POST, Constant.SOCKET_MSG_TYPE_LOGIC);
                } else if (stateCode == 2) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "金钱不足!");
                }
                break;
            case Constant.MSG_NET_CMD_CHECK_MONEY://查询金钱
                stateCode = cmdData.readByte();
                long checkmoney = cmdData.readLong();
                if (stateCode == 1) {
                    MainLogic.getInstance().uiEquipment.getmoney(checkmoney);
                    MainLogic.getInstance().uiEquipment.sStrArray_gold = new String[1];
                    MainLogic.getInstance().uiEquipment.sStrArray_silver = new String[1];
                    MainLogic.getInstance().uiEquipment.sStrArray_copper = new String[1];
                    MainLogic.getInstance().uiEquipment.SendEmail_State = 4;
                    MainLogic.getInstance().inputInterFace.setInputInterFace(MainLogic.getInstance().uiEquipment.byUiState, "添加龙币");
                    MainLogic.getInstance().inputInterFace.commonInput2.setString(MainLogic.getInstance().uiEquipment.sStrArray_gold[0]);
                    MainLogic.getInstance().inputInterFace.commonInput3.setString(MainLogic.getInstance().uiEquipment.sStrArray_silver[0]);
                    MainLogic.getInstance().inputInterFace.commonInput4.setString(MainLogic.getInstance().uiEquipment.sStrArray_copper[0]);
                    MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
                }
                break;
            case Constant.MSG_NET_CMD_OPEN_MERIDIAN:
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    int playerpoints;
                    int mer_num = 0;
                    String mer_str = "";
                    int learnMer_num = 0;
                    String learnMer_str = "";
                    MainLogic.getInstance().uiEquipment.init();
                    playerpoints = cmdData.readInt();
                    MainLogic.getInstance().uiEquipment.playerPoints = playerpoints;
                    mer_num = cmdData.readInt();
                    MainLogic.getInstance().uiEquipment.Meridianslearn_Str = new String[mer_num][3];
                    for (int b = 0; b < mer_num; b++) {
                        mer_str = cmdData.readUTF();
                        MainLogic.getInstance().uiEquipment.getMeridianslearn_Str(mer_str, b);
                    }
                    learnMer_num = cmdData.readInt();
                    MainLogic.getInstance().uiEquipment.Meridians_Str = new String[learnMer_num][3];
                    for (int b = 0; b < learnMer_num; b++) {
                        learnMer_str = cmdData.readUTF();
                        MainLogic.getInstance().uiEquipment.getMeridiansStr(learnMer_str, b);
                    }
                    for (int c = 0; c < MainLogic.getInstance().uiEquipment.Meridians_Str.length; c++) {
                        Tools.printLog(c + "    " + MainLogic.getInstance().uiEquipment.Meridians_Str[c][0]
                                + "    " + MainLogic.getInstance().uiEquipment.Meridians_Str[c][1]
                                + "    " + MainLogic.getInstance().uiEquipment.Meridians_Str[c][2]);
                    }
                    MainLogic.getInstance().pushState(Constant.GAME_UI_MERIDIANS, true);
                    mer_str = null;
                    learnMer_str = null;

                }
                break;
        }
    }
}
